This makes it difficult to conditionally render segments of the nav.
Two things which to better enable conditional rendering to be easier:
- Allowing
React.Fragment>
- Allowing
undefined
Made-up code example of what I'm trying to accomplish:
function conditionRender() {
if (condition) return (<EuiNavDrawerGroup listItems={linksTwo} />);
// All nested navs in here are broken 👇
return (<>
<EuiNavDrawerGroup listItems={linksTwo} />
<EuiNavDrawerGroup listItems={linksThree} />
</>);
}
const render = () => (
<EuiNavDrawer>
<EuiNavDrawerGroup listItems={linksOne} />
{this.conditionalRender()}
</EuiNavDrawer>);
);
This makes it difficult to conditionally render segments of the nav.
Two things which to better enable conditional rendering to be easier:
React.Fragment>undefinedMade-up code example of what I'm trying to accomplish: