-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
ref type broken for HTMLElement #951
Comments
see also interface Foo1 { [Symbol.iterator]: any }
interface Foo2 { }
const foo1: Ref<Foo1|null> = ref<Foo1|null>(null);
const foo2: Ref<Foo2|null> = ref<Foo2|null>(null);
console.log(foo1, foo2); |
(Sorry for the close, mouse finger messed up ^^) We can easily fix the problem with For the more general case about
type UnwrapTest<T> = {
[P in keyof T]: T[P]
} & (T extends { [Symbol.iterator]: infer V } ? { [Symbol.iterator]: V } : {}) should be adaptable for our UnwrapRef implementation and seems to go in a similar direction as @pikax's PR. |
Version
3.0.0-alpha.12
Reproduction link
https://codesandbox.io/s/infallible-https-w248t?file=/src/index.ts
Steps to reproduce
Note the error on line 4 of
index.ts
.What is expected?
ref<HTMLElement | null>(null)
is assignable to a variable of typeRef<HTMLElement | null>
.What is actually happening?
Perhaps some issue with symbols in the
UnwrapRef
declaration? The full error includes the lineProperty '[Symbol.iterator]' is missing in type
.The text was updated successfully, but these errors were encountered: