You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/docs/hooks-faq.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -467,7 +467,7 @@ Yes. See [conditionally firing an effect](/docs/hooks-reference.html#conditional
467
467
Generally speaking, no.
468
468
469
469
```js{3,8}
470
-
function Example() {
470
+
function Example({ someProp }) {
471
471
function doSomething() {
472
472
console.log(someProp);
473
473
}
@@ -481,7 +481,7 @@ function Example() {
481
481
It's difficult to remember which props or state are used by functions outside of the effect. This is why **usually you'll want to declare functions needed by an effect *inside* of it.** Then it's easy to see what values from the component scope that effect depends on:
0 commit comments