You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to reason-react docs instance variables should be stored in state and be marked with ref instead of mutable to prepare for concurrent react.
I am unsure whether this makes any difference for a global state management solution like reductive, but would be nice to have a better insight into this from someone who has a better understanding of the internals of reductive and reason-react. If it does make a difference, the fix is rather simple but nice to have to be ready for the future changes.
Would appreciate any opinions/thoughts on this :)
The text was updated successfully, but these errors were encountered:
hm... yes, that makes sense. However, the docs I linked show an example in reasonml playground that demonstrates the difference when reading from state from a closure. Then it seems to work incorrectly if using mutable since the data might get stale by the time it is accessed. So it seems like there might be a risk of having the same problem in reductive..
Please correct me if I am misunderstanding something!
For the function api I think preferring useRef where possible makes sense. For the old API yes, you must use a ref inside of state instead of a mutable field. Is there a scenario in the function api where useRef doesn't make sense?
According to
reason-react
docs instance variables should be stored instate
and be marked withref
instead ofmutable
to prepare for concurrent react.I am unsure whether this makes any difference for a global state management solution like
reductive
, but would be nice to have a better insight into this from someone who has a better understanding of the internals ofreductive
andreason-react
. If it does make a difference, the fix is rather simple but nice to have to be ready for the future changes.Would appreciate any opinions/thoughts on this :)
The text was updated successfully, but these errors were encountered: