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
useEffect vs useLayoutEffect #87
Comments
It seems we can use setTimeout to simulate them for now. |
So your current implementation of |
Yes, It actually more like useLayoutEffect, but now #86 bothers me, It will take me more time to fix 😭 |
Hello, I have implemented useeffect and uselayout. Now I will explain the implementation and principle of it. difference between them
role for them
About testsMaybe we only need to test I will reevaluate the test form PRs |
Any particular reason not to name it Regarding the render-tests, I think you can roll back most of the changes you made to the test-conditions - all the tests were designed to work with what is now called For the most part, you can simply replace every reference to We won't have any tests for what is now called Once we're back in green, we can start working on tests for the new |
I have rolled back most of the tests and let me debug them ~ just a few days ~ :laugh: |
We seem to have the useLayout test. I'll close it first. |
Should we add support for
useLayoutEffect
?From this article about the difference:
From the React docs:
Also from the React docs:
From my understanding, if you had an implementation of
useLayoutEffect
, addinguseEffect
could be as simple as this:I did notice Preact has two separate implementations and dispatches them differently, so I'm not sure about this.
What do you think?
The text was updated successfully, but these errors were encountered: