Any downsides to putting this directly in the render?
... return props.items.map(doSomething).map(...) ...
If there is no need to write the items into the state this would of course be the best solution.
items
useEffect() gets relevant if you need the data in the state because it can be changed through user interactions for example.
useEffect()
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Any downsides to putting this directly in the render?
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.