These errors were mostly cases with React class components, where the new version of Flow wants a return type on every function defined in the class.
There were two exceptions:
- Flow didn't like us checking request.endpoint when request could be falsey, even though request was checked right before. Solved this by replacing the check with the optional chaining operator.
- In inflight-requests.js, Flow didn't like that we were checking the value of this.clearRequest before an await... Flow was afraid the value could change during the await. I fixed this by assigning the value to a local variable before checking it.
NOTE: CI will fail on this diff. I considered the possibility of fixing Flow errors BEFORE upgrading Flow, but it wasn't possible... in some cases, the fixes to support the new version of Flow caused errors in the old version. I could have hidden these type errors with $FlowFixMe lines and then later revert those, but that seemed like too much busy work.
Depends on D9709