Does anyone have an idea how to pass the react-router params object explicitly to a component?
I want to make something like this, because unit testing would be easier if I could pass the ApiClient from outside:
function FooComponent() {
const apiClient = new ApiClient('http://foo.bar');
return (
<Bar apiClient={apiClient} param={?No idea how to pass the token param?} />
);
}
<Router history={history}>
<Route path="/test" component={Test} />
<IndexRoute component={TestIndex} />
<Route path="/validate/:token" component={FooComponent} />
</Router>