Skip to content
Discussion options

You must be logged in to vote
import { dispose } from '@react-three/fiber'

function Foo() {
  const { scene } = useGLTF(url)
  useEffect(() => () => scene.traverse(dispose), [])

dispose is a small helper that we export https://github.com/pmndrs/react-three-fiber/blob/master/packages/fiber/src/web/index.tsx#L159 but you can dispose it yourself any way you want.

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@drcmda
Comment options

@srcnalt
Comment options

@drcmda
Comment options

@srcnalt
Comment options

@srcnalt
Comment options

Answer selected by srcnalt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants