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
Uh oh!
There was an error while loading. Please reload this page.
-
Putting the
currentmember field into the interface allows us to expose a read-onlyRef.current. AnmObserversfield is added to MutableRef. Whencurrentis assigned, the observers can get the latest value. Based on these, the extension functionobserveAsStateis written, which can conveniently pass the ref as a state when needed.Beta Was this translation helpful? Give feedback.
All reactions