three-mesh-ui
three-mesh-ui copied to clipboard
deepDelete is this function working correctly?
I think that deepDelete from src/utils/deepDelete.js is not working correctly.
I can see that there is different version in examples/utils/deepDelete.js
Here is code example: https://codesandbox.io/s/exciting-antonelli-svcfcm?file=/src/index.js
../three-mesh-ui-6.5.4/utils/deepDelete.js
is src/utils/deepDelete.js version
../three-mesh-ui-6.5.4/utils/deepDelete2.js
is examples/utils/deepDelete.js version
I have added some console logs.
There is one Block on scene (cube) with child Block (cube1) that have child InlineBlock in it. cube |_cube1 |_imgBlock
When running deepDelete from src/utils version there is only one log with top Block.
If you change import to deepDelete2
examples/utils version suddenly all children are logged in console and looks like removed correctly.
Which version of deepDelete is correct and should be used to remove objects?