So coming from an Angular/AngularJS background, you have states, and each state is a separate page. E.g. in a social network you can have a state with your feed, a state with a
I'd recommend you to check react-router to solve this situation
It easily allows you to create custom routes like this:
import React from "react";
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
const BasicExample = () => (
-
Home
-
About
-
Topics
);
const Home = () => (
Home
);
const About = () => (
About
);
const Topics = ({ match }) => (
Topics
-
Rendering with React
-
Components
-
Props v. State
Please select a topic.
}
/>
);
const Topic = ({ match }) => (
{match.params.topicId}
);
export default BasicExample;
For the documentation and other examples, like nested Routing, checkout this page.