Quoted By:
Here is the useSubmit hook's implementation. The hook simulates an API call; it waits for 2 seconds ( const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); ) then sets a response, based on a random number; there's a ~50% chance of success or failure.
Any ideas how I can get the hook to return the data ( return { isLoading, response, submit }; ) before onOpen tries to open the alert? Or is the implementation they supplied me with just flawed? I know it probably doesn't matter much for this little project, but it kinda bugs me.