MCPcopy
hub / github.com/pmndrs/react-three-fiber / useThree

Function useThree

packages/fiber/src/core/hooks.tsx:34–39  ·  view source on GitHub ↗
(
  selector: (state: RootState) => T = (state) => state as unknown as T,
  equalityFn?: <T>(state: T, newState: T) => boolean,
)

Source from the content-addressed store, hash-verified

32 * @see https://docs.pmnd.rs/react-three-fiber/api/hooks#usethree
33 */
34export function useThree<T = RootState>(
35 selector: (state: RootState) => T = (state) => state as unknown as T,
36 equalityFn?: <T>(state: T, newState: T) => boolean,
37): T {
38 return useStore()(selector, equalityFn)
39}
40
41/**
42 * Executes a callback before render in a shared frame loop.

Callers 15

CubeFunction · 0.90
AdaptivePixelRatioFunction · 0.90
AdaptiveEventsFunction · 0.90
ContainerFunction · 0.90
HudFunction · 0.90
ViewcubeFunction · 0.90
CaptureFunction · 0.90
PortalFunction · 0.90
TestFunction · 0.90
ViewFunction · 0.90
ContainerFunction · 0.90
ObjectFunction · 0.90

Calls 1

useStoreFunction · 0.85

Tested by 6

ComponentFunction · 0.72
ComponentFunction · 0.72
TestFunction · 0.68
NormalFunction · 0.68
PortalFunction · 0.68
TestComponentFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…