I am creating a one-page application with React and Backbone, and I am trying to find best practices for handling navigation between content in the application. My application will have a sidebar with links, for example, to “photos” and “settings”. The sidebar is always present, therefore, by clicking "Settings", I want the settings component to be displayed without a complete page reload. Slack is a great example of what I'm looking for when clicking on another channel switches the contents of the conversation, but does not reload the entire page.
I had a few ideas on how to implement this, but I'm not sure which is best:
- Have a common reaction component (console.jsx) that takes the URL as a support to determine which content (photos or settings) will be displayed.
or 2. have a common reaction component and define a state variable that represents what content to render.
Any help would be greatly appreciated!
source share