79606869

Date: 2025-05-05 12:00:46
Score: 1.5
Natty:
Report link

you are correct in your suspicion: each call of the hook manages its own state. they do not share state. when you refresh, your hook just fetches data again. if you want higher-level state management, useContext or react redux are options. useContext is another native hook that allows nested components to share. redux is more intense: could be more than you need, but could be exactly what you're looking for. i gravitate towards useContext when possible, as it is relatively simple.

Reasons:
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (0.5):
Posted by: sparkJ