Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redux state is being set directly rather than by Redux #1953

Closed
12 tasks done
jmgrady opened this issue Mar 14, 2023 · 2 comments · Fixed by #2800
Closed
12 tasks done

Redux state is being set directly rather than by Redux #1953

jmgrady opened this issue Mar 14, 2023 · 2 comments · Fixed by #2800
Assignees
Labels
bug Something isn't working frontend javascript Pull requests that update Javascript code Size: L Large sized issue

Comments

@jmgrady
Copy link
Collaborator

jmgrady commented Mar 14, 2023

Describe the bug

Elements of the Redux state variable are being set outside of reducer that handles dispatched actions.

To Reproduce

Steps to reproduce the behavior:

  1. Open ./src/store.ts.
  2. In the call to configureStore, change the value of the immutableCheck property for the default middleware to true.
  3. Run npm start to rebuild as a development build and start the application.
  4. In the web browser that is opened:
    1. Open the browser debugging tools
    2. Log in to The Combine and open a project
    3. Click Review Entries
    4. An error message is displayed on the console explaining where the error is found.
  5. Repeat for other combine operations, e.g. Data Entry, Merge Duplicates, etc.

Expected behavior

No errors reported.

Environment:

Redux reducers to be ported:

@jmgrady jmgrady added bug Something isn't working frontend javascript Pull requests that update Javascript code labels Mar 14, 2023
@jmgrady jmgrady self-assigned this Mar 14, 2023
@jmgrady
Copy link
Collaborator Author

jmgrady commented Mar 14, 2023

May be related to #1939

@jmgrady
Copy link
Collaborator Author

jmgrady commented Mar 25, 2023

See the section on Immutability in the Redux Essentials tutorial. The state must never be updated directly; rather, a copy must be made, updated, and returned by the reducer functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working frontend javascript Pull requests that update Javascript code Size: L Large sized issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants