DEV Community

Discussion on: 8 React Performance Tricks: Make your app blazing fast!

Collapse
 
sanderdebr profile image
sanderdebr

This is possible, but the linter will tell you that there is a missing dependency, in this case getCocktails(). useEffect is depending on external values that may change, when you set the dependencies as an empty array the effect will run just once when the component mounts.