OverviewHistoryStatsSecurity
npx skills add ...
Documentation
SKILL.md
npx skills add enzed/r3f-skills --skill r3f-loaders
Load and reuse 3D assets in React Three Fiber with useGLTF, useLoader, Suspense, and preloading. Use for model loading, decoder setup, caching, cloning, or loading/error UI.
npx skills add enzed/r3f-skills --skill r3f-loaders
Inspect installed Fiber, Drei, Three.js, and React versions first. Examples use Fiber 9 / React 19. Verify actual asset paths, node names, formats, and compression; do not invent a model's structure.
Mount below Canvas. Supply /models/robot.glb in the application. These clones have separate object transforms but intentionally share cached geometry/materials.
useGLTF for glTF/GLB; use useLoader with the matching Three.js loader for other formats. Fiber 9 also accepts an externally owned loader instance when configuration isolation is needed.null as a pretend URL or call a hook conditionally.three/addons/loaders/GLTFLoader.js. Check installed exports for renamed loaders; modern Three.js uses HDRLoader where older examples used RGBELoader.ThreeElements['group'], not the removed global JSX type namespace.SkeletonUtils.clone root makes ownership explicit.dispose={null} on the shared subtree). An application cache owner may release them only after all consumers are gone.useGLTF.clear(url) nor useLoader.clear(...) is a complete GPU cleanup operation.useGLTF integrates Draco/Meshopt support, but decoder URLs and loader configuration must match the asset and hosting policy. For KTX2 textures, configure a KTX2Loader with renderer capability detection before loading.useProgress reflects the loading manager's activity, not necessarily one asset's byte-accurate completion. Avoid treating an unavailable Content-Length as a trustworthy denominator.