Answer the question
In order to leave comments, you need to log in
How to exclude certain paths from processing by React Router?
There is a React SPA whose routes are processed using react-route (and react-router-redux), something like this:
ReactDOM.render(
<Provider store={store}>
<ConnectedRouter history={history}>
<Switch>
<Route exact path="/" render={() => <Services />} />
<Route path="/accounts" render={() => <div>Accounts</div>} />
<Route render={() => <div>404</div>} />
</Switch>
</Content>
</Layout>
</ConnectedRouter>
</Provider>,
document.getElementById("root")
);
<Route path="/api/*" render={ document.location.replace(history.location.pathname)} />
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question