Replies: 1 comment 2 replies
-
I don't know what this has to do with typescript-go. Did you mean to file this in http://github.com/microsoft/TypeScript? |
Beta Was this translation helpful? Give feedback.
2 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.
-
In React.js, it's pretty common to have to do this:
However, in a better world, you could just do:
In this case:
x
represents a reference to aFramework.StateObject<T>
x
is used like anumber
everywherex
is returned as aFramework.StateObject<T>
(e.g. where the context type isFramework.StateObject<T>
)The same case repeats for contexts and references/refs.
I'd like a solution for this, but it does have to be done at the TypeScript-level.
Beta Was this translation helpful? Give feedback.
All reactions