RobotsAndPencils / react-gantry

R&P's React Starter Kit
4 stars 1 forks source link

Get Routing Working #14

Closed stuarttannehill-rp closed 6 years ago

stuarttannehill-rp commented 6 years ago

Need to set the project up to support react-router while working correctly with redux.

akrigline commented 6 years ago

A couple things we need to think about here are: What Router do we want to use? Normally people just use the BrowserRouter. But there's a good number of pros to using a connected-router as discussed here.

Pros include:

Cons:

How are we setting up our Root Routes? With React-Router v4, we don't have a static route object anymore, which is great, but somewhere the different routes of the app might need to still behave similarly. Should this be a project-level decision? Or should we include something like a Root Route file?

        <BrowserRouter>
          <Switch>
            <Route path='/' exact component={HomeRoute} />
            <Route path='/:id' component={SmartUpdateHome} />
          </Switch>
        </BrowserRouter>