1. 24
    Add React Router to a Redux Application
    2m 50s

Add React Router to a Redux Application

InstructorAndy Van Slaars

Share this video with your friends

Send Tweet

In this lesson, we’ll install React Router as a project dependency and add links that will update the url via pushState to avoid reloading our page on changes.

Juan Marco
~ 6 years ago

It looks like this particular video might need an update. Since React Router V4 We need to import import { BrowserRouter as Router } from 'react-router-dom' directly into index.js and wrap the entire app in the <Router> component. Like this:

import { BrowserRouter as Router  } from 'react-router-dom'

ReactDOM.render(
  <Router>
    <Provider store={store}>
      <App />
    </Provider>
  </Router>,
  document.getElementById('root')
)

See more on this here