Ref has been refactored #4
Closed
junerver
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Putting the
current
member field into the interface allows us to expose a read-onlyRef.current
. AnmObservers
field is added to MutableRef. Whencurrent
is assigned, the observers can get the latest value. Based on these, the extension functionobserveAsState
is written, which can conveniently pass the ref as a state when needed.Beta Was this translation helpful? Give feedback.
All reactions