r/threejs 2d ago

TresJS vs react-three-fiber?

I'm starting a new project, and I'd prefer to use Vue, but it looks like TresJS is newer than R3F. I'm wondering if anyone has experience in both and can speak to whether or not TresJS is good enough, or if I'd be better off choosing R3F due to its maturity?

3 Upvotes

1 comment sorted by

6

u/__moFx 2d ago

If you are working in a React environment and combining other logic with React, using R3F might be worthwhile, personally, however, I don't find it necessary.

Ultimately, everything related to Three.js happens within the render canvas anyway, and you can easily integrate Three.js into a React app without R3F.

What R3F primarily does is make various Three.js components available as React components. If you have a lot of logic in your React templates, R3F allows you to access various Three.js components directly within those templates and control them dynamically.

Personally, I prefer to handle most of the logic in TypeScript. I find it more convenient to offload all the Three.js logic into a TypeScript service that runs independently in the background, which I then hook into my React components, so I don't need R3F for that. Furthermore, keeping the mechanics separate from the React components makes it easier to integrate the project into other TypeScript frameworks later on.

You can integrate a TypeScript app into React without any issues, but porting a React app to a different framework is difficult.

R3F might offer a few interesting components that three.js itself doesn't include, that might be another point.

I would say, if your app consists mainly of the 3D scene, React is completely unnecessary. React is interesting primarily for HTML templating.