Replies: 1 comment 1 reply
-
Based on that call stack, it looks like whatever form library you're using is trying to directly mutate the data from Redux, which is bad. I don't have an immediate fix/solution, other than check how the library wants to update state, and you may need to make copies of the data to pass that form library. Also, as an unrelated side note: you don't have to do all those manual spreads in the reducer, and also the line |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Am having issues updating a redux store in NEXTJS. am building a CV platform with the feature to preview users' input almost immediately into a preview page. this cv platform has the experience, education etc that a normal cv platform should have and am using the react hook form package to manage forms and also to enhance dynamic forms.
so because the preview component will be another project on its own, I need the best way to pass data from my app into the preview app. Then I thought of passing every form input, cv styles, and data to a redux store so the preview component can just get the user's data from the store
as I said earlier, am using the react hooks form library to manage my form, so to update the store in real-time whenever the user inputs anything, I imported the useWatch hook from react hook form to watch my form in case of any data changes. so I set up a useEffect to listen for any useWatch change to dispatch the whole useWatch data to the store. NB: this data contains an array of objects
my challenge right now is that anytime I dispatch the data to store, redux toolkit or probably immer frowns at what am doing and will always break the app, returning back this error message
Below is the redux store and how am setting the experience
Below is how am setting the form and dispatching it
I'll appreciate any help to fix this issue am facing. Thanks
Beta Was this translation helpful? Give feedback.
All reactions