Thank you for great library
const App = () => <Router>
<Swtich>
<route path="/a' component={()=><Link to="/b"}>B</Link>} />
<route component={()=><Link to="/a"}>A</Link>} />
</Switch>
<Router>
export const AppContainer = connect(state, props)(withRouter(App));
ReactDOM.render(
<Provider store={store}>
<Router>
<AppContainer store={store} />
</Router>
</Provider>,
rootEl
);
edit index.js replace
// export const AppContainer = connect(state, props)(withRouter(App));
//with
export const AppContainer = withRouter(connect(state, props)(App));
now every thing will work as expected.
4.0.0
withRoute should work regardless of HOC
You have your withRouter and connect in the wrong order: https://reacttraining.com/react-router/core/api/Prompt
yp, thats the issue, it shouldn't be (order sensetive)
It should be a real component and force update. Then in react 16 it wouldn't even have to make an element.
I think it has to do with this