pixijs / pixi-react

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

Bug: @pixi/react v.7.1.0 is not working with React v.17.0.2 #435

Closed uichleba closed 11 months ago

uichleba commented 1 year ago

Current Behavior

Cannot read properties of undefined (reading 'current') TypeError: Cannot read properties of undefined (reading 'current') at ensureRootIsScheduled (http://localhost:3000/static/js/bundle.js:17203:40) at scheduleUpdateOnFiber (http://localhost:3000/static/js/bundle.js:17105:11) at Object.updateContainer (http://localhost:3000/static/js/bundle.js:20011:11) at Stage.componentDidMount (http://localhost:3000/static/js/bundle.js:21324:17) at commitLifeCycles (http://localhost:3000/static/js/bundle.js:48463:28) at commitLayoutEffects (http://localhost:3000/static/js/bundle.js:50809:11) at HTMLUnknownElement.callCallback (http://localhost:3000/static/js/bundle.js:34158:18) at Object.invokeGuardedCallbackDev (http://localhost:3000/static/js/bundle.js:34202:20) at invokeGuardedCallback (http://localhost:3000/static/js/bundle.js:34257:35) at commitRootImpl (http://localhost:3000/static/js/bundle.js:50580:13)

Expected Behavior

Working without error.

Steps to Reproduce

Observe the error.

Environment

Possible Solution

No response

Additional Information

No response

polimorficzny commented 1 year ago

Having the same issue when trying to update from v5. @uichleba have you found some workarounds maybe?

uichleba commented 1 year ago

@polimorficzny I just used old version of pixi-react v6.8.0. That work just fine until we upgrade react & react-dom to v18.2.0

met5678 commented 1 year ago

Same issue here but with React v17.0.1

lunarraid commented 11 months ago

Unfortunately the fiber reconciler upgrades are not compatible with React < 18. You will need to use React 18 or above going forward. It is unlikely this will change.