pixi-react
pixi-react copied to clipboard
Feature Request: Improve DOMContainer handling
Hey! Pixi.js 8.9 introduced a new DOMContainer element, allowing integrating DOM elements in the scene graph. Pixi-react correctly handles this:
function SomeComponent() {
const element = useMemo(() => {
const el = document.createElement('div');
// ...
return el;
}, []);
return <pixiContainer>
// ...
<pixiDOMContainer element={element} />
</pixiContainer>
}
But it would be great if the DOM element can be handled declaratively via react-dom, e.g. something like
<pixiDOMContainer>
<div>
{/* ... */}
</div>
</pixiDOMContainer>
I don't know very much about using multiple fibers in react, so not sure if this is even possible.
We've discussed this in Discord! We need to do a lot of research to figure out how to handle this appropriately, but we absolutely want to make sure it's well supported. I don't know how soon we'll get it done, but know that it's on our radar. 😉