79549026

Date: 2025-04-01 19:37:22
Score: 1.5
Natty:
Report link

All the responders to this question are incorrect / do not understand the question.

The way to do this is using refs. In your example you'd need to maintain a ref to the updated array, and access that from within useEffect. The ref will never change so you don't need worry about adding it as a dependency.

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: ibrust