Hooks can only be used inside the Canvas element because they rely on context! You cannot expect something like this to work:
function App() {const { size } = useThree() // This will just crashreturn (<Canvas><mesh>
Do this instead:
Edit this page on GitHub
function SomeComponent() {const { size } = useThree()return <mesh />}function App() {return (<Canvas><SomeComponent />