Skip to content
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

consider adding some version of useLayoutEffect #1438

Open
sdegueldre opened this issue May 23, 2023 · 1 comment
Open

consider adding some version of useLayoutEffect #1438

sdegueldre opened this issue May 23, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@sdegueldre
Copy link
Contributor

Sometimes you want to measure some DOM element and then immediately rerender and patch the DOM with a different. Currently, doing this in useEffect causes flickering since any rendering scheduled in useEffect will only be patched on the next animation frame, cause the incorrect state to be briefly painted by the browser. Consider adding a way to schedule a synchronous re-render and patch.

@sdegueldre sdegueldre added the enhancement New feature or request label May 23, 2023
@ged-odoo
Copy link
Contributor

i guess it can be done, however, the question has to be asked, what if we have async sub components?

to that, the first answer that comes to mind is to raise an error and limit the use of such a hook to cases where we have a sync component with only sync children.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants