You have to be careful when passing
useFetch to keep object identity. Typically, one could use
useMemo to control the object identity. Please checkout the following example.
Do you mean without Context? It’s technically possible and I’ve tried that. One of the drawbacks is said to be a possible incompatibility with Concurrent React.
If your question is about the implementation with a context and hooks, please check out my follow-up post:
Hi! Thanks for the report. May I ask a favor? Could you file an issue in the github repo and continue the discussion there? I’d like to have a better understanding of your “useEffect” problem.
Object.values does not work with this example, because
readBody is not identical every time it’s created. I understand your suggestion and I’d build a less-generic hook which only accepts primitive options to avoid