DEV Community

Discussion on: Handle 'componentWillReceiveProps' deprecation warning

Collapse
 
marcostreng profile image
Marco Streng

If there is no need to write the items into the state this would of course be the best solution.

useEffect() gets relevant if you need the data in the state because it can be changed through user interactions for example.