pro-mern-stack
pro-mern-stack copied to clipboard
hash history is now available in new package react-router-dom
please use BrowserRouter, also follow the reference
import React from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter, Route } from 'react-router-dom';
import IssueList from './issuelist.jsx';
import IssueEdit from './issueedit.jsx';
const contentNode = document.getElementById('contents');
const NoMatch = () => <p>Page not found.</p>;
const RoutedApp = () => (
<BrowserRouter>
<div>
<Route path="/" component={IssueList} />
<Route path="/edit" component={IssueEdit} />
<Route path="/h*" component={NoMatch} />
</div>
</BrowserRouter>
);
ReactDOM.render(<RoutedApp />, contentNode); // Render the component inside the content Node
if (module.hot) {
module.hot.accept();
}