Typescript: How can we pass extra parameters as props in the example from the Introduction? #2136
Unanswered
RednarRosique
asked this question in
Q&A
Replies: 1 comment
-
I haven't found anything definitive yet either, but since you are using TypeScript, you can safely add custom anything to any Object3D https://threejs.org/docs/#api/en/core/Object3D.userData
Then in your
outputs
Therefore you could say,
and that would return the number |
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.
-
Hi,
Taking the Typescript example shown at https://docs.pmnd.rs/react-three-fiber/getting-started/introduction I'm now wondering what's the right way to do it if I want to pass an extra prop like a "box size". Is it something like this?
If I do the above, the boxSize prop works for me, but I can't get the position to do its thing. I dug through the documentation but couldn't find anything that hinted at the right way to do this. Does anyone have any advice?
Btw, on the component declaration tsserver gives me an error like
Property 'position' does not exist on type 'IntrinsicAttributes & BoxProps
.Beta Was this translation helpful? Give feedback.
All reactions