File tree Expand file tree Collapse file tree 1 file changed +10
-16
lines changed
examples/vite-3DCanvas-react-app/src/components/viewers Expand file tree Collapse file tree 1 file changed +10
-16
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ const classes = {
1616 } ,
1717} ;
1818
19- function MyRotatingBox ( ) {
19+ const Canvas3DExample : React . FC = ( ) => {
2020 const myMesh = useRef < Mesh > ( ) ;
2121 const [ active , setActive ] = useState ( false ) ;
2222
@@ -25,23 +25,17 @@ function MyRotatingBox() {
2525 myMesh . current . rotation . x = a ;
2626 } ) ;
2727
28- return (
29- < mesh
30- scale = { active ? 1.5 : 1 }
31- onClick = { ( ) => setActive ( ! active ) }
32- ref = { myMesh }
33- >
34- < boxGeometry />
35- < meshPhongMaterial color = "royalblue" />
36- </ mesh >
37- ) ;
38- }
39-
40- const Canvas3DExample : React . FC = ( ) => {
4128 return (
4229 < Box className = { classes . container } style = { classes . container } >
43- < Canvas3D onLoadError = { ( e ) => console . log ( e ) } >
44- < MyRotatingBox />
30+ < Canvas3D >
31+ < mesh
32+ scale = { active ? 1.5 : 1 }
33+ onClick = { ( ) => setActive ( ! active ) }
34+ ref = { myMesh }
35+ >
36+ < boxGeometry />
37+ < meshPhongMaterial color = "royalblue" />
38+ </ mesh >
4539 </ Canvas3D >
4640 </ Box >
4741 ) ;
You can’t perform that action at this time.
0 commit comments