Skip to content Skip to sidebar Skip to footer

React-router Push Callback?

I need to trigger a synchronous action after react-router push, which appears to be async Is it possible to do something like: dispatch(push('/', callbackFunction)) I don't see an

Solution 1:

As it seems, push is not asynchronous since it is just an action creator (factory pattern).

So you could trigger you actions like this:

dispatch(push('/'));
dispatch(otherAction());

Relevant lines

Post a Comment for "React-router Push Callback?"