diff --git a/use-effect-hook/src/efficient-use-effect/app.tsx b/use-effect-hook/src/efficient-use-effect/app.tsx index 011d97f..c50bf1d 100644 --- a/use-effect-hook/src/efficient-use-effect/app.tsx +++ b/use-effect-hook/src/efficient-use-effect/app.tsx @@ -41,7 +41,8 @@ export function Main() { }, // The dependencies array here describes, "Hey React, please re-run this effect when the listener changes." // Be very careful when you use non-primitive types, like functions and objects, in the dependencies array. Every - // function is different from every other function, even if the function bodies are the result of copy/paste. + // function is different from every other function, even if you feel that the function bodies are "the same" because + // they are the result of copy/paste. // React uses the "Object.is" method (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) // to compare the old and new values of the dependencies array. [listener]) diff --git a/use-effect-hook/src/inefficient-use-effect/app.tsx b/use-effect-hook/src/inefficient-use-effect/app.tsx index 5dca532..a43d6ea 100644 --- a/use-effect-hook/src/inefficient-use-effect/app.tsx +++ b/use-effect-hook/src/inefficient-use-effect/app.tsx @@ -39,7 +39,8 @@ export function Main() { }, // The dependencies array here describes, "Hey React, please re-run this effect when the listener changes." // Be very careful when you use non-primitive types, like functions and objects, in the dependencies array. Every - // function is different from every other function, even if the function bodies are the result of copy/paste. + // function is different from every other function, even if you feel that the function bodies are "the same" because + // they are the result of copy/paste. // React uses the "Object.is" method (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) // to compare the old and new values of the dependencies array. [listener]) diff --git a/use-effect-hook/src/root/app.tsx b/use-effect-hook/src/root/app.tsx index c35e222..4b90f35 100644 --- a/use-effect-hook/src/root/app.tsx +++ b/use-effect-hook/src/root/app.tsx @@ -4,7 +4,7 @@ import ReactDOM from 'react-dom/client' export function Main() { return (<>