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

.get returns old value, .toJs returns new value #13

Open
Methuselah96 opened this issue Oct 16, 2020 · 0 comments
Open

.get returns old value, .toJs returns new value #13

Methuselah96 opened this issue Oct 16, 2020 · 0 comments

Comments

@Methuselah96
Copy link
Owner


Migrated from don't!
Originally created by @dor6 on Fri, 24 Apr 2020 12:53:19 GMT


I get a new immutable map after using set (the value is an object) in the new map object when i use toJS (or just use console.info on it) i get the updated object, when I use get on the value i updated (which is an object btw) I get the old value.

I do the same action twice becuase i have the object twice, once in a list inside a context and once in a function that opens a modal base on this object. the update heppens inside the modal. the list updates just fine but the object inside the modal has the above problem.

My solution was cloning the object using "fromJS(object.toJS())".

My code is in react native, I cant share the code because of confidentiality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant