pixi-react icon indicating copy to clipboard operation
pixi-react copied to clipboard

Feature Request: Improve DOMContainer handling

Open zOadT opened this issue 9 months ago • 1 comments

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.

zOadT avatar Mar 29 '25 11:03 zOadT

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. 😉

trezy avatar Apr 03 '25 18:04 trezy