Browse Source

Grammar

main
Dan Abramov 4 years ago
committed by GitHub
parent
commit
b4a3bc7d0d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      content/blog/2020-08-10-react-v17-rc.md

2
content/blog/2020-08-10-react-v17-rc.md

@ -164,7 +164,7 @@ Most effects don't need to delay screen updates, so React runs them asynchronous
However, when a component is unmounting, effect *cleanup* functions used to run synchronously (similar to `componentWillUnmount` being synchronous in classes). We've found that this is not ideal for larger apps because it slows down large screen transitions (e.g. switching tabs).
**In React 17, the effect cleanup function will always runs asynchronously -- for example, if the component is unmounting, the cleanup will run _after_ the screen has been updated.**
**In React 17, the effect cleanup function always runs asynchronously -- for example, if the component is unmounting, the cleanup runs _after_ the screen has been updated.**
This mirrors how the effects themselves run more closely. In the rare cases where you might want to rely on the synchronous execution, you can switch to `useLayoutEffect` instead.

Loading…
Cancel
Save