carbon-addons-iot-react
carbon-addons-iot-react copied to clipboard
[SideNav] SideNav not updating for SuiteHeader
What package is this for?
- [x] React
- [ ] Angular
Describe the bug
we pass links data to sidenav, but we found the sidenav component won’t refresh when the links data updated, so we have to only initialize this component after all data ready.
@davidicus
@zhaozhuo813 Hello, would you please offer more details for this issue? So far, I couldn't reproduce it.
In SideNav story, we have knobs like show deep nesting example, Demo pinned link during search and Demo most recent links to change the links prop. Whenever we change any of the knobs, the link data changed and we can see the change reflected in the SideNav story. I also tried update the link meta, the change also got picked up.
Anything we missed? Thanks!
@jessieyan I'm not sure if it's caused by using an old version, in our project, it uses carbon-addons-iot-react: 2.150.1-next.12 in last release code. When we pass links which has not been initialized first, but later, we update links and it will not take effect to the side nav. <SideNav links={links} isSideNavExpanded={isLeftNavOpen} />
@zhaozhuo813
The version 2.150.1-next.12 should work fine.
Do you manage state of the links? You would need to mange a state of the links. When links state changes, it triggers the re-render of <SideNav>
Please feel free to reopen if issues still exist.