React: Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state
问题 I want to have active NavLink "submenu key" in React state to tell NavLink's onClick() method to check if any of NavLinks in Collapse is active and if so, don't toggle isOpen for Collapse. 1. I want to stop collapsing current Collapse if one of NavLink inside Collapse is active 2. Would be nice to have opened Collapse after refreshing site (of course if some NavLink inside is Active) This code gives me Cannot update during an existing state transition (such as within 'render'). Render methods