-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
Hacky fixing overlaps #63
Comments
I am not using hooks, is there any way that I can use this hack? I am currently using setState to set children to render but initial layout is overlapping. If I updateLayout 1 seconds later using setTimeout, it works. |
@berkayk if you are using setState this means and async update is scheduled, so your previous render doesn't have the children? It depends on where you are calling setState, I would recommend putting the data which the grid depends on into props either in its parent component or extract it into a thin SFC with the hook above, which contains only that and other props which go to StackGrid |
Im using this in children component and it works smoothly https://github.com/maslianok/react-resize-detector
|
Instead of the requestanimationframe hack, you can use useRef to store a class variable.
|
That's very helpful. I tweaked the solution slightly to trigger
|
I found that this works by updating the layout after 1 animation frame:
The text was updated successfully, but these errors were encountered: