Closed bjornstar closed 2 years ago
This is a backwards compatible change that enables the use of forwardRef without casting.
forwardRef
Currently we have to use forwardRef like this:
const Ball = forwardRef<Object3D, SphereProps>((props, ref) => { const [, { position }] = useSphere( () => ({ type: 'Kinematic', args: 0.5, ...props }), ref as RefObject<Object3D>, ) }
With this change we can use ref directly:
ref
const Ball = forwardRef<Object3D, SphereProps>((props, ref) => { const [, { position }] = useSphere(() => ({ type: 'Kinematic', args: 0.5, ...props }), ref) }
This is a backwards compatible change that enables the use of
forwardRef
without casting.Currently we have to use forwardRef like this:
With this change we can use
ref
directly: