-
-
Notifications
You must be signed in to change notification settings - Fork 108
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 prop missing type for functional ref #427
Comments
PatrickByrn
pushed a commit
to PatrickByrn/tres
that referenced
this issue
Oct 29, 2023
…add number and symbol Updated `ref` in VueProps to use `VNodeRef` type from vue, to support using a function ref. Also updated key to accept numbers and symbols Tresjs#427 Tresjs#427
alvarosabu
pushed a commit
that referenced
this issue
Oct 30, 2023
…mber and symbol (#428) Updated `ref` in VueProps to use `VNodeRef` type from vue, to support using a function ref. Also updated key to accept numbers and symbols #427 #427 Co-authored-by: Patrick Byrn <[email protected]>
manuel139
pushed a commit
to manuel139/tres
that referenced
this issue
Sep 4, 2024
…mber and symbol (#428) Updated `ref` in VueProps to use `VNodeRef` type from vue, to support using a function ref. Also updated key to accept numbers and symbols #427 Tresjs/tres#427 Co-authored-by: Patrick Byrn <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Current type definitions don't allow for a function to be passed to the
ref
prop of a component, so any time you use a functional ref you'll run into a type error.Apologies for not including a reproduction or sample but this should be quick to recreate in any dev environment with the reproduction steps.
Reproduction
/
Steps to reproduce
const sphereRefs = ref<Object3D[]>([]);
const setSphereRefs = (el: any) => { if (el && !sphereRefs.value.includes(el)) { sphereRefs.value.push(el); } };
ref
property:ref="(el) => "setSphereRef(el)"
ref
prop despite this being a common use for theref
prop.System Info
No response
Used Package Manager
yarn
Code of Conduct
The text was updated successfully, but these errors were encountered: