mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 20:23:08 +00:00
Fix grammar (#2676)
This commit is contained in:
committed by
Alex Krolick
parent
99a18287c1
commit
3f64033e6e
@@ -143,7 +143,7 @@ Although `useEffect` is deferred until after the browser has painted, it's guara
|
||||
|
||||
The default behavior for effects is to fire the effect after every completed render. That way an effect is always recreated if one of its dependencies changes.
|
||||
|
||||
However, this may be overkill in some cases, like the subscription example from the previous section. We don't need to create a new subscription on every update, only if the `source` props has changed.
|
||||
However, this may be overkill in some cases, like the subscription example from the previous section. We don't need to create a new subscription on every update, only if the `source` prop has changed.
|
||||
|
||||
To implement this, pass a second argument to `useEffect` that is the array of values that the effect depends on. Our updated example now looks like this:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user