Updating React props after scene has rendered

Hey everyone, does anyone know of a way to specifically change react props after the scene has already rendered? I wrote a quick sandbox here to better explain the issue I’m having (upbeat-mclean-qf9l5 - CodeSandbox). Treating this example like my project, I don’t have access to the Cube function and I’m trying to change the cube’s mat color by specifically changing the color parameter in the Cube function. I left a console log of the tree of react props I am trying to edit.

That’s my issue; here’s a bit more info on the project I’m working on for more context. It’s important that I change the mat color in this example by changing its function parameter because I’m building a r3f editor completely in 3D using r3f. I have some r3f components each with their own parameters that all do different things and I want users to be able to edit these react function params and have the changes update live on the site.
Thanks

if you’re trying to change the cubes color from the dummy component then that makes no sense, children and jsx is just vdom, these aren’t real objects, and that would also defeat reacts purpose. r3f renders into into threejs itself. even though you have logically grouped the canvas into a div, the only child the div will receive is the dom canvas tag, the actual meshes and materials are in threejs, they’re not part part of the div.

maybe add some more comments to that box because i really don’t get what this is for. or give it some kind of goal with the restrictions you need. otherwise i’d say just use useState and distribute the color prop. or use a state manager like in this example Shoe configurator - CodeSandbox (both the dom and threejs share the same state model here)

Yes, I’ll elaborate more on the problem. The problem is that, in the case of this codepen as it relates to my project, the Cube function is being precompiled and served as a UMD so I don’t have access to it. If possible, I want to be able to get the vdom from a precompiled component, modify it, and then have it refresh to show the new changes.

The precompiled components are loaded in as such: