Skip to content

Commit 320c9f7

Browse files
committed
readme update
1 parent 482d9a0 commit 320c9f7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

README.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
A simple wrapper to run vanilla ThreeJS code inside a React component.
44

5-
- Uses React 18 and Vite server. (Latest as of Aug 2023).
5+
- Uses React 18 and Vite. Also a branch showing use with Next.js.
66
- Uses [Leva](https://github.com/pmndrs/leva) React GUI to show passing props from React -> ThreeJS.
77

88
## Philosophy
99

10-
[React-three-fiber](https://github.com/pmndrs/react-three-fiber) is great if you want to write your ThreeJS code with JSX. If you prefer coding ThreeJS with vanilla JS, this template might be useful for you.
10+
[React-three-fiber](https://github.com/pmndrs/react-three-fiber) is great if you want to write your ThreeJS code with JSX. If you prefer coding ThreeJS with vanilla JS, this template might be useful for you. Any of the [ThreeJS examples](https://threejs.org/examples/) can be loaded into this wrapper.
1111

1212
## Available Scripts
1313

@@ -21,6 +21,11 @@ In the project directory, you can run:
2121

2222
In Dev mode you will notice the ThreeJS init() and dispose() calls are fired twice on mount. This is caused by using [React.StrictMode](https://react.dev/reference/react/StrictMode#fixing-bugs-found-by-double-rendering-in-development) which causes components to be rendered twice. Since the dispose() function cleans up properly you can safely ignore this issue. Double render does not happen in production mode.
2323

24+
## Branches
25+
26+
- `main` - Uses the [Vite](https://vitejs.dev/) build tool.
27+
- `nextjs-build` - Uses the [Next.js](https://nextjs.org/) framework. Based off of `npx create-next-app`.
28+
2429
## Note on Resizing
2530

2631
In this example, the ThreeJS canvas size is defined by the `#canvas-container` CSS. ThreeJS resizing logic is fired by a `ResizeObserver` to allow changing the size of the canvas from React.

0 commit comments

Comments
 (0)