Rename articles prefixed with javascript-

This commit is contained in:
Angelos Chalaris
2023-05-18 23:24:53 +03:00
parent db4fc1d50b
commit f1931acb2c
106 changed files with 78 additions and 78 deletions

View File

@ -12,7 +12,7 @@ dateModified: 2022-06-12T05:00:00-04:00
Conditionally firing an effect is a pretty common requirement when working with React. In most cases, this is as simple as passing a dependency array to `useEffect()`. Turns out that, in some cases, this can cause unnecessary performance degradation.
Such issues arise when entire objects are passed as dependencies when you only need a primitive value. Due to the nature of objects, [being pass-by-reference](/articles/s/javascript-pass-by-reference-or-pass-by-value), comparing the dependencies will always trigger a re-run. This ends up causing effects to run unnecessarily.
Such issues arise when entire objects are passed as dependencies when you only need a primitive value. Due to the nature of objects, [being pass-by-reference](/js/s/pass-by-reference-or-pass-by-value), comparing the dependencies will always trigger a re-run. This ends up causing effects to run unnecessarily.
```jsx
const CartItem = ({ item }) => {