React Three Fiber useThree

Created
Created
2021 Aug 4 9:55
Refs
Refs
RTF useThree camera
RTF useThree zoom
 
 
RTF useThree viewport
RTF useThree size
 
 

Optimization

rerender 안되려면
필요 state만 꼭 불러오도록
// Will only trigger re-render when the default camera is exchanged const camera = useThree((state) => state.camera) // Will only re-render on resize changes const viewport = useThree((state) => state.viewport) // ❌ You cannot expect reactivity from three.js internals! const zoom = useThree((state) => state.camera.zoom)
 
 
 
 

Recommendations