MCPcopy Create free account
hub / github.com/QuarkGluonPlasma/react-course-code / Mesh

Function Mesh

hello-r3f/src/App.jsx:8–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6import { GLTFLoader } from 'three/examples/jsm/Addons.js';
7
8function Mesh() {
9 const meshRef = useRef();
10
11 useFrame((state, delta) => {
12 meshRef.current.rotation.y += 0.1;
13 });
14
15 function clickHandler() {
16 meshRef.current.material.color.set('blue');
17 }
18
19 return <mesh ref={meshRef} onClick={clickHandler}>
20 <boxGeometry args={[100, 100, 100]}/>
21 <meshPhongMaterial color={'orange'}/>
22 </mesh>
23}
24
25function App() {
26 return <Canvas camera={{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected