Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hashHistory and IndexRoute in react-router 4.2.0 #2

Open
AndressaStefany opened this issue Apr 5, 2018 · 3 comments
Open

hashHistory and IndexRoute in react-router 4.2.0 #2

AndressaStefany opened this issue Apr 5, 2018 · 3 comments

Comments

@AndressaStefany
Copy link

AndressaStefany commented Apr 5, 2018

Thank you for this implementation, but I adpted this for version react-router 4.2.0.

I modified in index.js:

<MuiThemeProvider >
  <HashRouter>
    <App />
  </HashRouter>
</MuiThemeProvider>

And, I added in App.js:

import { HashRouter as Router, Route, Link } from 'react-router-dom'
import Home from './components/Home'
import About from './components/About'
...
render() {
  return (
    <Router>
      <div> ...
        <Route exact path='/' component={Home}/>
        <Route path='/about' component={About}/>
      </div>
    </Router>
  )
}
@DaxChen
Copy link
Owner

DaxChen commented Apr 5, 2018

Haven't been following these for a while now, can you make a PR for this?

@AndressaStefany
Copy link
Author

Yes, I can.

@kristianmandrup
Copy link

I believe another, simpler solution, would be to have a NavLink inside each MenuItem and then provide the router on the AppBar or Drawer using withRouter HOC?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants