External: react-three/fiber

react-three/fiber

A React renderer for three.js.

Build your scene declaratively with re-usable, self-contained components that react to state, are readily interactive and can participate in React's ecosystem.
Source:
See:

Methods

(static) useFrame()

Subscribe this component to the render-loop, to rotate the mesh in each frame.

This hook allows you to execute code on every rendered frame, like running effects, updating controls, and so on. You receive the state (same as useThree) and a clock delta. Your callback function will be invoked just before a frame is rendered. When the component unmounts it is unsubscribed automatically from the render-loop.
Source:

(static) useThree()

This hook gives you access to the state model which contains the default renderer, the scene, your camera, and so on. It also gives you the current size of the canvas in screen and viewport coordinates.
Source: