ReactDOM.render(
<Provider store={store}>
<ConnectedRouter history={history}> { /* place ConnectedRouter under Provider */}
<div>
<Switch>
<Route exact={true} path="/enthusiasm" component={Hello} />
<Route exact={true} path="/shipments" component={ShipmentsTable} />
<Route exact={true} path="/shipments/:pickUpId" component={ShipmentInfoPage} />
</Switch>
</div>
</ConnectedRouter>
</Provider>
,
document.getElementById('root') as HTMLElement
);
this is giving me an error saying,
A <Router> may have only one child element, and it has only one element.
everything is according to the example in connected-router repo
and this was working fine with BrowserRouter, any help.
Version Info
- connected-react-router "4.4.1",
- react-router: "4.3.1",
- react: "16.4.2"