carbon-addons-iot-react icon indicating copy to clipboard operation
carbon-addons-iot-react copied to clipboard

[SideNav] renderedFilterableLinks state prevents SideNav links from being update

Open jeffrey-pinyan-cleandns opened this issue 3 years ago • 1 comments

What package is this for?

  • [X] React
  • [ ] Angular

Describe the bug

Lines 320-322 in SideNav.js make it impossible to update the links sent to SideNav, because renderedFilterableLinks never accounts for changes to filterableLinks (e.g. changes to isActive).

  const [renderedFilterableLinks, setRenderedFilterableLinks] = useState(
    renderLinks(filterableLinks)
  );

jeffrey-pinyan-cleandns avatar Aug 01 '22 06:08 jeffrey-pinyan-cleandns

Hi @jeffrey-pinyan-cleandns, thanks for submitting the issue. Can you provide a little more detail on your setup and issue so we can help resolve? As you can see in this story, we have the filterable links set and are able to update the isActive prop. Here is the code for the story where we are updating the state of the links

davidicus avatar Aug 08 '22 14:08 davidicus