|
1 | 1 | # threejs-react-wrapper
|
2 | 2 |
|
3 |
| -Simple wrapper to run vanilla Threejs code inside a React component. |
| 3 | +Simple wrapper to run vanilla ThreeJS code inside a React component. |
4 | 4 |
|
5 |
| -Using React 17.0.2 with functional components and hooks. React code based on [Create React App](https://github.com/facebook/create-react-app) (as of April 2021). |
| 5 | +Using a [Leva](https://github.com/pmndrs/leva) GUI to show passing props into ThreeJS. |
6 | 6 |
|
7 |
| -This template handles running regular ES6 Threejs code (as provided in the Threejs examples) inside a bigger React site. Handles loading / unloading and hot-reloads. |
| 7 | +Using React 18 and Vite server. (Latest as of April 2023). |
8 | 8 |
|
9 | 9 | ## Philosophy
|
10 | 10 |
|
11 |
| -[react-three-fiber](https://github.com/pmndrs/react-three-fiber) is great if you love React and want to write your 3D code with JSX and hooks. If you prefer coding Threejs with vanilla JS / ES6 classes / modules, this template might be useful for you. |
| 11 | +[react-three-fiber](https://github.com/pmndrs/react-three-fiber) is great if you want to write your 3D code with JSX. If you prefer coding Threejs with vanilla JS / ES6 classes / modules, this template might be useful for you. |
12 | 12 |
|
13 | 13 | ## Available Scripts
|
14 | 14 |
|
15 | 15 | In the project directory, you can run:
|
16 | 16 |
|
17 |
| -### `npm install` |
| 17 | +`npm install` - Install dependencies. |
18 | 18 |
|
19 |
| -Install dependencies. |
| 19 | +`npm run dev` - Runs the app in the dev mode. |
20 | 20 |
|
21 |
| -### `npm start` |
22 |
| - |
23 |
| -Runs the app in the development mode.\ |
24 |
| -Open [http://localhost:3000](http://localhost:3000) to view it in the browser. |
25 |
| - |
26 |
| -The page will reload if you make edits.\ |
27 |
| -You will also see any lint errors in the console. |
28 |
| - |
29 |
| -### `npm run build` |
30 |
| - |
31 |
| -Builds the app for production to the `build` folder.\ |
32 |
| -It correctly bundles React in production mode and optimizes the build for the best performance. |
33 |
| - |
34 |
| -The build is minified and the filenames include the hashes.\ |
35 |
| -Your app is ready to be deployed! |
| 21 | +`npm run build` |
36 | 22 |
|
37 | 23 | ## ScreenShot
|
38 | 24 |
|
39 | 25 | 
|
40 |
| - |
41 |
| -## TODO |
42 |
| - |
43 |
| -- handle async loading within ThreeWrapper (e.g load config data or assets before three init completes) |
0 commit comments