function DrawCurve({ data }) {
// do something with data
return (
<someThreejsThing whatever={data}>
how that data change is reflected in the view (threejs) is up to you. if you dont see a change then you’re handling threejs in a wrong way. for instance, geometry was just removed, everything is now a buffergeometry which is slightly more complex to update. some objects can’t be updated, they must be re-instanciated etc.
if you have a codesandbox i can tell you why you don’t see changes but pls reduce it to its minimum.
The framework I am using is of the company,which they are very adamant to share.I wanted to make a minimum of the code the time you told me npx codesandbox would be sufficient but the data utilized to create the scene are taken from local modules and api calls(loads of backend work) that would take looong to add in a customized framework.
Can you check out the code below?
The below takes in an array vectors and renders a curve.
what i can tell you right off the bat is that this is invalid code. hooks can not be conditional. and you have side effects in the render function, which should be pure, there should be no new FOO.bar() etc.
local state goes into const [local] = useState(() => new FOO.Bar())
local conditional state into const local = useMemo(() => new FOO.Bar(arg), [arg])