pixijs / pixi-react

Write PIXI apps using React declarative style
https://pixijs.io/pixi-react/
MIT License
2.33k stars 177 forks source link

Multiple apps rendered simultaneously #339

Closed Ledzz closed 2 years ago

Ledzz commented 2 years ago

Description

If using more than one app on the page, they all are rendered simultaneously. I'd like to create PR to fix this behavior. My idea is to fire __REACT_PIXI_REQUEST_RENDER__ events on the canvas instead of window. @inlet are you ok with this approach? If yes, I'll make a PR in a few days.

inlet commented 2 years ago

Thanks @Ledzz good point!

It does indeed make sense to move the events to the canvas element. Thanks you for your collaboration, looking forward to review your PR.

Please add tests for multiple scenario's.

Thanks 🙏