redux-first-router | 🎖 seamless redux-first routing -- just dispatch actions | State Container library
kandi X-RAY | redux-first-router Summary
kandi X-RAY | redux-first-router Summary
seamless redux-first routing -- just dispatch actions
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of redux-first-router
redux-first-router Key Features
redux-first-router Examples and Code Snippets
Community Discussions
Trending Discussions on redux-first-router
QUESTION
I am digging into React with Redux for a rewrite of our product. A lot of fog around Redux was cleared by using Redux-Toolkit https://redux-toolkit.js.org/. Then I found that React-Router made state management messy and found a solution in redux-first-router https://github.com/faceyspacey/redux-first-router.
Now I want to combine these excellent libraries. But I think I'm doing something wrong in the configuration. Here is the code. Starting with a sandbox example at https://codesandbox.io/s/m76zjj924j, I changed the configureStore.js file into (for simplicity I have omitted code for the user reducer)
...ANSWER
Answered 2020-Jan-19 at 19:14I'm a Redux maintainer and creator of Redux Toolkit.
Based on that error message and reading the Redux-First-Router source code, it looks like the library is indeed attempting to store thunk functions in the Redux store. This is a problem, because we specifically instruct users to never put non-serializable values like functions in state or actions.
By default, Redux Toolkit adds a "serializable state invariant middleware" that warns you if non-serializable values are detected in state or actions, to help you avoid accidentally making this mistake.
It is possible to pass some options to getDefaultMiddleware()
to customize the behavior of these middlewares. There is currently an ignoredActions
option, but I don't think we have an option to ignore specific sections of the state tree. The included redux-immutable-state-invariant
middleware does have an ignore
option for portions of the state, so perhaps we could add that approach.
I've added https://github.com/reduxjs/redux-toolkit/issues/319 to see if we can add an option like that.
In the meantime, you could potentially turn off the middleware by calling getDefaultMiddleware({serializableCheck: false})
.
update
I've just published Redux Toolkit v1.2.3, which adds an ignoredPaths
option to the serializability check middleware to allow ignoring specific keypaths within the state.
Again, please note that this is purely an escape hatch to work around misbehaving libraries, and should not be used as a regular approach.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install redux-first-router
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page