import {editable as e, SheetProvider} from '@theatre/r3f' import {getProject} from '@theatre/core' import React, {useEffect, useState} from 'react' import {Canvas} from '@react-three/fiber' import {PerspectiveCamera} from '@react-three/drei' import {useExtensionButton} from '../../shared/utils/useExtensionButton' document.body.style.backgroundColor = '#171717' const EditableCamera = e(PerspectiveCamera, 'perspectiveCamera') function App() { const project = getProject('R3F Hot Reload Test') const sheet = project.sheet('Scene') return (
) } // initial config of "Cube 1" const cube1Config1 = {a: 1} // we change the default value of a, and add a new prop const cube1Config2 = {a: 2, b: 2} // we re-use the previous config const cube1Config3 = cube1Config2 function Scene() { const [state, setState] = useState(1) useExtensionButton('Step forward', () => { setState((s) => s + 1) }) useEffect(() => {}, []) if (state === 1) { return ( ) } else if (state === 2) { return ( <> ) } else if (state === 3) { return ( ) } else { return null } } export default App