Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type of unref #3954

Closed
MinatoHikari opened this issue Jun 15, 2021 · 0 comments
Closed

type of unref #3954

MinatoHikari opened this issue Jun 15, 2021 · 0 comments

Comments

@MinatoHikari
Copy link

@MinatoHikari MinatoHikari commented Jun 15, 2021

Version

3.1.1

Reproduction link

https://codesandbox.io/s/awesome-bird-y636n?file=/src/demo.ts

Steps to reproduce

just click into the codesandbox link

What is expected?

the return type is K

What is actually happening?

<T>(ref: T): T extends Ref<infer V> ? V : T cannot exactly get inner Type of params which has a type K | Ref<K>


Type of unref should be <T>(ref: T | Ref<T>): T
When we use unref, we certainly want to get the inner Type of a ref or params' type. So it is better to use the genetic as inner Type of Ref or the type of a value which is not ref.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants