issue reseting values to undefine, display in React old Value #860
Replies: 2 comments 1 reply
-
https://livecodes.io/?x=id/b7musf4nkg6 |
Beta Was this translation helpful? Give feedback.
-
hi @dai-shi your code is really similar to mine (mine is a real project with several states but I'd need to find how reproduce this, I'd need to check this more deeply in the weekend because I know that the clear function is being called but when I put
doesn't work...but when I call this as
it works as expected, it's weird, I'd need check what is happening, right now I noticed that in the devtools the value is updated correctly, so seems a problem with the react component, but I'm using useSnapshot correctly, my project is using NextJS, it doesn't seem to be the problem because as I said, the function prints a console.log indicating that the state is reset, but my component doesn't display the change...thanks for your reply, I'll come back when I can reproduce this error |
Beta Was this translation helpful? Give feedback.
-
hi, good day, I've an state set like this
suppose that color is optional, so could be undefined, if I reset my data like this
in react I'm using useSnapshot
in react name is correctly clear but age still shows "red" as value, although the value must set to undefined
same problem happens when I set this to undefine manually
Beta Was this translation helpful? Give feedback.
All reactions