Solution 1:[1]
Yes. Props can be used in useEffect hook. Props are just values, when it is used in a useEffect dependency array, the component will re-render.
// This will only re-run if the value of `props.count` changes
useEffect(() => {
fetchSomeData(props.count);
}, [props.count]);
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Mehedi Zamadar |

