Tag: react

  • Whoops, we called that API twice

    In one of my codebases at work we have a custom React hook for rendering the result of a promise: At first blush this may seem fine. This function takes a promise object, sets it on state, and then fires a useEffect to register a callback that updates component state with the result of the…