My app includes a right sidebar that can display chat, help, or search options, based on user input. I noticed that similar apps use hidden nodes rendered in plain HTML when toggling visibility.
I am considering implementing this feature with React, but I understand that React elements have states which trigger the render method. This allows me to store the sidebar's visibility and content within the state.
Is using states in React the best approach for handling this? Should I keep all nodes rendered even if they are not visible, or should I render nodes as needed based on changes in the state?