Making Found react to Farce push/replace actions
See original GitHub issueI set up Found using the createConnectedRouter
way. When I dispatch push
or replace
actions from Farce, I see that they’re dispatched, but the reducer state doesn’t change and as a result I’m not redirected to the target location.
Is there anything obvious that I missed in the config? Basically I need a way to redirect the user from within my action creators.
Issue Analytics
- State:
- Created 6 years ago
- Comments:15 (6 by maintainers)
Top Results From Across the Web
Programmatically navigate using React router - Stack Overflow
React Router makes the properties and methods of the history instance associated with your router available through the context, under the router object....
Read more >CommonActions reference - React Navigation
A navigation action is an object containing at least a type property. ... navigator will create a new route with the specified key...
Read more >How To Use Routing with React Navigation in React Native
First, create a new React Native app by entering the following command in your terminal: npx react-native init MySocialNetwork --version 0.63.2.
Read more >React Navigation re-render / reset previous page's state on ...
actions.js (image from code). In above case, you dont have any scope to change the state of the parent component and clear the...
Read more >React Native Navigation: Tutorial with examples
Using stack navigator to navigate between screen components. Let's begin by first creating a /components folder in the root of our project. Then ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Going to close this out for now – this seems like a Redux limitation with a few decent enough workarounds, and I don’t want to constrain the API by making these be strictly middlewares.
It gets used by the rest of Found to pass methods around from the store.
Take a look at the code snippet I have above. There’s no necessary or technical reason why middlewares can’t dispatch upstream to enhancers.
You can also see that the core of both Farce and Found does sit in middlewares, so we could rejigger the API to expose the middlewares more directly. However, I don’t think I can get around the requirement of having to stick some methods onto the store, to allow e.g. the pattern where you just set up a
<Provider>
and pass everything around on the store object, without exposing users to potential bugs in case they install a middleware or enhancer before the Farce/Found middlewares that make actions async, or something.