React- managing multiple pages

I am working on Progressive Web App which uses React. The problem I ecountred is that I am not sure how manage another page. There is one html file in the project called "index.html. Should I create more and somehow swich between them? I found library called React Router which seems to solve the problem in a diffrent way (because I need urls to change as well). I am not sure if I should develop that as a one dynamic page because I would have tens of diffrent pages. What is the best practise?

Upvotes: 0

Views: 56

Answers (1)

Who Knows
Who Knows

Reputation: 101

The main purpose of Reactjs, is to build your webapp as a single javascript web application.

React-router will manage the routing on your app via the HTML5 history API.

It can also manage the head of you HTML page with React-Helmet or other packages. All you have to do is to include your app script into your single HTML page.

React-router v4 is, in my opinion, the best router as it is designed in a React-way, for this purpose.

Upvotes: 1

Related Questions