pixijs / pixi-react

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

Move update events from window to root container #340

Closed Ledzz closed 2 years ago

Ledzz commented 2 years ago

Description: I've didn't manage to get the canvas instance from the hostconfig where events were emitted from, so I've basically done what react-three-fiber does: I store the root container in each pixi component. Not so elegant solution, but iterating through all branch of the tree to find root node seems a bit overhead. Also, I didn't add any new tests, bc I don't see any necessity. Maybe I should leave old window.dispatchEvent for backwards compatibility? Ideally I'd hide this behind some kind of global flag, but I don't know how to do it good.

Related issue (if exists):

339

Ledzz commented 2 years ago

I think I also need to update the docs. But I will do it after @inlet confirms the changes are OK.

saitonakamura commented 2 years ago

@inlet can you merge it and release a new version?

inlet commented 2 years ago

@saitonakamura will do that tomorrow