icode
icode

Reputation: 57

How to use React Router on pure HTML like React on browser

Is there any way to use React Router on pure HTML like React on the browser?

Example:

<script src="https://unpkg.com/react@15/dist/react.min.js"></script>

Upvotes: 2

Views: 516

Answers (1)

It&#39;sNotMe
It&#39;sNotMe

Reputation: 1260

React Router is beneficial for React Single Page Apps. Using it in pure HTML files isn't necessary. Here's a nice summary of React Router's purpose.

React Router, and dynamic, client-side routing, allows us to build a single-page web application with navigation without the page refreshing as the user navigates. React Router uses component structure to call components, which display the appropriate information.

The code example you shared hints at interest in using React from CDN rather than installing the library in your project. If that's the case, it may help to review the post Using React Router with CDN and without webpack or browserify.

Upvotes: 2

Related Questions