We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
You can continue the conversation there. Go to discussion →
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
Hi there,
Looks like setDefaultCamera was removed in 6.x. I could not find any mention of this in the release notes. Was this intentional?
setDefaultCamera
const { setDefaultCamera } = useThree();
now warns:
Property 'setDefaultCamera' does not exist on type 'RootState'.ts(2339
The text was updated successfully, but these errors were encountered:
Use const { set } = useThree()
const { set } = useThree()
function CustomCamera (props) { const cameraRef = useRef() const set = useThree(({ set }) => set) const size = useThree(({ size }) => size) useLayoutEffect(() => { if (cameraRef.current) { cameraRef.current.aspect = size.width / size.height cameraRef.current.updateProjectionMatrix() } }, [size, props]) useLayoutEffect(() => { set(() => ({ camera: cameraRef.current })) }, []) return <perspectiveCamera ref={cameraRef} /> }
https://github.com/pmndrs/react-three-fiber/blob/master/markdown/api.md#usethree
Sorry, something went wrong.
No branches or pull requests
Hi there,
Looks like
setDefaultCamera
was removed in 6.x. I could not find any mention of this in the release notes. Was this intentional?now warns:
The text was updated successfully, but these errors were encountered: