-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in Hooks: ReactPixiFiber did not render into container provided #156
Comments
@Othreumaru can you reproduce this also in 0.12.0? If you could provide some code sandbox with this happening that would be great. You can use this template as a starter. |
I have narrowed down the root cause of my problem to be options object changing on Stage causing a circular unmount loop since that was triggering update to my context. My case might be rare so feel free to close this. |
I can see if it is possible to eliminate such unmount loop if you could share a minimal options object that could be used to reproduce that scenario. |
I'm pretty sure I'm also running into this issue. I'll try to recreate it and fix it. |
Actually, I think my issue has something to do with my app code. This example of changing |
@michalochman oh wow, you've made some major changes. I didn't see your reply until after posting my last one. If there are any outstanding issues with this after your refactor, or if you just need some testing done, I can help out. |
Getting the same error. Not sure what's going on, because it's part of pretty complex app. Any update on #47 getting merged in? |
@vojto I've encountered another issue that seems related to this one. To work around it until 47 is merged, you can try the workaround I've been using, which is to use the PXI Stage class instead. Import createStageClass and call it to get your Stage component. |
@nstolpe Thanks for that. I just got #47 running locally, so I'm gonna play with that for a while, and if it fails, I'll try your approach. FYI for anyone who wants to run this from another branch. I didn't have much luck adding it as Yarn dependency from Git, so what I ended up doing was just opening my |
@vojto I am pretty happy with #47, however I'm a little afraid that the way it works now may give a lot of users heart attacks due to the amount of warnings – I have decided to make these warnings opt-in instead, but extra work will be needed. I'm currently exploring |
I have just released |
bug seems to be resolved with |
Works very well for me. |
@michalochman sorry, just got some time to work on my project. Both issues I mentioned here seem to have been cleared up now. |
@michalochman I've been using 1.0.0-beta.1 for a while now, but see that master has been updated more recently. Is the beta still the best branch to stick with? |
@nstolpe I will update the beta branch today if you're an active user. There are several reasons it has staled:
|
Turns out it will take me more time to rebase beta to |
@nstolpe I have just published 1.0.0-beta.2 with all features that were missing from the current branch. |
@michalochman thanks for the update and for doing that so fast. I'll update to the new beta tonight. |
I can confirm Now hot module replacement won't break my game anymore. |
|
Description
I believe around version 0.10.0 with PR
#127
A subtle bug was introduced. It can occur when react renders a component then that render triggers a change for example layout resize which triggers rerender in a sync way. Which causes fiber to unmount previous component which throws exception
ReactPixiFiber did not render into container provided
This happens because in hooks.js inside usePixiAppCreator inside useLayoutEffect you return a function that expects that component was already mounted. However not is perfectly normal in react for that method to be called before component is mounted.
Steps to reproduce
Additional info
The text was updated successfully, but these errors were encountered: