Skip to content

Solid Three Code Design

Scott Vorthmann edited this page May 3, 2023 · 1 revision

Nikhil grabbed the core of react-three-fiber source and made as few modifications as possible to remove the React mechanisms and replace them with SolidJS mechanisms. Most of the core folder is essentially untouched, though he had to replace zustand/react zustand/vanilla, and something about priorities.

The r3f contract for a React reconciler was very close to what he needed for a Solid universal renderer.

The RootState model is unchanged, stored with Zustand per canvas.

Are all supported Canvas props being sent to createThreeRoot()?

He had difficulties with HMR, so it is probably still buggy.

In Solid, a component function can return anything, so Nikhil has a separate experiment where a universal renderer is not required at all. It is up to the parent to determine what to do with the child. It uses proxies so a separate element need not be created for every Three object.

more to come

Clone this wiki locally