Closed coder89 closed 2 years ago
Currently BabylonNode<T> declares ref as Ref<ReactNode>. Therefore we need to write something like this:
BabylonNode<T>
ref
Ref<ReactNode>
const ref = useRef(); useEffect(() => { const mesh = ref.current as Mesh; }, []); return <mesh ref={ref} />
generatedProps.d.ts should be updated to allow below:
generatedProps.d.ts
const ref = useRef<Mesh>(); useEffect(() => { const mesh = ref.current; }, []); return <mesh ref={ref} />
I have created a PR that fixes the issue: #217
Thanks. I’ll merge in tonight. Appreciate the PR!
Currently
BabylonNode<T>
declaresref
asRef<ReactNode>
. Therefore we need to write something like this:generatedProps.d.ts
should be updated to allow below:I have created a PR that fixes the issue: #217