Preface: I have been using unity and unreal engine professionally since 2018 and have been a web developer since 2016. I would not call myself a React expert, but I know enough to be productive. Please feel free to give high or low level responses, I am just trying to get a gauge for how to go about developing with r3f and ensure I am not fighting with it.
TL;DR building dynamic game architectures with r3f seems like I am fighting the library. Not sure where to use vanilla Three.js and where to use r3f, and whether that’s a bad practice.
I have recently started working with r3f and while I have managed to get through the simple stuff rather easily, .e.g., loading and viewing .gltf models, setting up cameras, and scenes, updating models in the game loop, etc., but now I am beginning to wonder how I should go about architecting more “game-like” and architecturally scalable systems.
From what I can tell one of the selling points of r3f is the ability to setup scenes, meshes, essentially all Three.js components declaratively. I see the utility in that sort of workflow for web developers who just want to setup simple scenes for a web page or share a demo, but building a game requires much more than the objects in the scene at the first render. Three.js makes handling managing object instances, adding and removing objects, etc., rather easy, but it is unclear how might be the best way to do the same in r3f. The docs seem to assume most of what you’d want to add would be known prior to first render and provide examples for doing that.
Most examples and projects I’ve scene generally build very simple/static, albeit pretty scenes. I also noticed that most use a state library for managing state across their components, which seems weird because Three.js already stores most information about the scene, object, etc., but I can see why they do it.
Formalized question: How should I manage scene objects (add, remove, get), update game object properties, manage object relationships, etc., within the r3f workflow.