After a review, I add a list of proposals for improvement:
Instead of:
const calculated = ctx.filterTabs(tabs, tabsPermissions);
return <TabsPanel tabs={calculated} {...props} />
Do:
return <TabsPanel tabs={tabs} tabsPermissions={tabsPermissions} {...props} />
After a review, I add a list of proposals for improvement:
useTraversalhook. It is not recommended that the libraries directly expose the context and users have to writeuseContext(TraversalContext).onChangenow sometimes receives the value and other times the event.Ctx.filterTabsand instead use TabPanel props. Or keep both, but I would make the TabPanel have this controlled by default.Instead of:
Do:
currentTabprop of the TabPanel behavior. If thecurrentTabdoesn't match with any tab that the user has permissions, then the first tab should be selected.doActionwhat actions are available without having to consult our documentation.CONTRIBUTING.md,LICENSE...linkstatedependency (only used in 1 component)react-useto own hooks: It's importing 60kb for 3 simple hooks...