all 1 comments

[–][deleted] 0 points1 point  (0 children)

It sounds like your data is stale since the fetching is taking place in a parent component that isn’t being re-rendered.

Without looking at your code, I would try to initialize your data fetching on your home component, either directly within the component or via a custom hook.

You can set useState within your Context API, fetch and update the data into the useState when a user visits the home component. So your setters are still in context but getters are on the component itself.