How do you declare the types for the SpotLight component? #476
Unanswered
nicolasguasca1
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Why are you doing it this way to render a spot light? Doesn't |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This example is perfectly working but the types won't work well yet to compile it.
I have the following:
Here is my doubt...how do I make typescript understand that the
ref
for theSpotLight
component is retrieved from the set function? As of now it assumes is brings the component itself instead of the function that configures it: Type 'Dispatch<SetStateAction>' is not assignable to type 'Ref | undefined'.Also, if the props attribute from the SpotLightElement function is being declared as JSX.IntrinsicElements from 'group' which will be the correct type to use instead, because now the
depthBuffer
property apparently doesn't exist in the JSX.IntrinsicElements.Any help will be much appreciated. Thank you!!!
Beta Was this translation helpful? Give feedback.
All reactions