You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NavDrawer only allows a specific whitelist of children (not sure exactly what it is) primarily: < /> and NavDrawerGroup.
This makes it difficult to break up large navs because you can't wrap parts of it in a component even if that component returns a NavDrawerGroup.
One workaround is to call the component as a function instead of trying to render it as a component. Other than looking hacky and being difficult to debug, I'm not sure if there are any other React-related side effects to doing that.
The best way to better support this functionality will be to have EuiNavDrawer define a React context which gets consumed by EuiNavDrawerGroup. That's all the child-specific logic really cares about - passing two values to the drawer group.
Summary
NavDrawer
only allows a specific whitelist of children (not sure exactly what it is) primarily:< />
andNavDrawerGroup
.This makes it difficult to break up large navs because you can't wrap parts of it in a component even if that component returns a
NavDrawerGroup
.One workaround is to call the component as a function instead of trying to render it as a component. Other than looking hacky and being difficult to debug, I'm not sure if there are any other React-related side effects to doing that.
Pseudo-example
Given a component:
This works:
While this does not:
The text was updated successfully, but these errors were encountered: