Replies: 1 comment
-
And I think it's impossible to open a feature request at the TypeScript repo, since they don't allow features that change JS behavior. |
Beta Was this translation helpful? Give feedback.
0 replies
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.
Uh oh!
There was an error while loading. Please reload this page.
-
useRef
s to avoid capture of outdated state or context. The only solution would be to support states as objects and special tsc/TSX compiler semantics ("compiler magic") so that things likestate
desugar intostate.value
..current
, so there also would need to be a compiler magic.Wondering if this is on the road.
So basically there needs to be something like:
And btw having this is totally possible and not a "too late" change, but requires the tsc team to do some work.
References
Equivalent to
useRef()
:Contexts
Equivalent to
useContext()
:Beta Was this translation helpful? Give feedback.
All reactions