ReactJS with React Router.

npm install react-router --save or

npm install react-router-dom --save

Use this command to install react router in your Application.

Use: import {Router, Route, browserHistory, Link } from 'react-router' or import {BrowserRouter, Route, Link } from 'react-router'

You can find a example of React Router below:

import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import { BrowserRouter, Route, Link } from 'react-router-dom';

const App = () => {
	return (
		<div>
			<h2>Home</h2>
			<Link to="/about">About</Link>
		</div>
	)
}

const About = () => {
	return (
		<div>
			<h2>About</h2>
			<Link to="/">Home</Link>
		</div>
	)
}

ReactDOM.render( 
	<BrowserRouter>
		<div>
			<Route path='/' component={App} />
			<Route path='/about' component={About} />
		</div>
	</BrowserRouter>,
	document.getElementById('root')
);