-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Reparenting of Space element results into remounting of children elements #31
Comments
@thekapadia There is actually a zIndex property on the spaces already which you can use with having to use the Layer wrapper. However, I'm pretty sure that the behaviour when changing that property (i.e. moving a space between different layers) will not work as expected - I will take a look at that. Give it a go anyway. |
@aeagle Right, the
I will implement this in my project and check if it resolves the remounting issue. Thanks a lot for your help. |
@thekapadia I'll close this in view of the specific issue you've raised #37 |
@aeagle This issue is related to the way Layer is currently implemented and facebook/react#3965.
Let me try and explain below.
Say, I have the following structure.
Now for some reason, I have to reparent the
<Space.Top size={100}>
component as shown below.So I removed
<Space.Top size={100}>
from the Layer and added it to the base structure.When I do this,
<MyComponent />
is destroyed and recreated entirely because of facebook/react#3965. This hits the performance of<MyComponent />
and also results in loss of itsstate
.I was thinking if React Spaces could additionally support layering by avoiding nesting, maybe by passing in a prop, something like below.
Thoughts?
The text was updated successfully, but these errors were encountered: