-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Seems to work great when working against valid URLs with responses; however, currently issuing infinite URL retries when the content is invalid or fails to load.
We tried to prevent this by keeping startTime as a state variable in the hook itself, which when checked with requestOnce helps ensure that only one request is sent; sadly it seems (I'm still learning hook-foo) that startTime isn't getting set properly, or the hook is otherwise dying/aborting and the component is remounting every time.
The first proposed solution is to figure out how to not-reload-the-hook upon fetch() failures; If we can't figure out how to not-reload-the-hook, the next step is probably to create a global const HTTPRequest = React.createContext() and share global state across all the hooks to make sure we're being nice to external services.