Page MenuHomePhabricator

[Flow202][lib][skip-ci] [2/23] Fix Flow issues with useDispatch / useSelector being underconstrained
ClosedPublic

Authored by ashoat on Nov 4 2023, 11:55 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 17, 3:31 PM
Unknown Object (File)
Mon, Dec 16, 12:50 AM
Unknown Object (File)
Thu, Dec 12, 8:54 PM
Unknown Object (File)
Tue, Dec 10, 4:21 AM
Unknown Object (File)
Mon, Dec 9, 7:07 PM
Unknown Object (File)
Mon, Dec 2, 9:14 AM
Unknown Object (File)
Tue, Nov 26, 4:39 AM
Unknown Object (File)
Tue, Nov 26, 2:36 AM
Subscribers

Details

Summary

The new version of Flow is requiring function calls to provide explicit type params when Flow isn't able to infer them.

While Flow isn't able to infer types from the generic useSelector in react-redux, our version of it has explicit types, and doesn't have that issue.

This diff migrates all of the errant imports of react-redux's useSelector to use ours. It also introduces a similar typed version of useDispatch, and migrates all callsites to use 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 D9693

Test Plan

Confirm the Flow errors go away

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Nov 4 2023, 12:06 PM
Harbormaster failed remote builds in B23736: Diff 32698!
This revision is now accepted and ready to land.Nov 5 2023, 10:29 AM
ashoat retitled this revision from [Flow202][lib] [2/23] Fix Flow issues with useDispatch / useSelector being underconstrained to [Flow202][lib][skip-ci] [2/23] Fix Flow issues with useDispatch / useSelector being underconstrained.Nov 19 2023, 11:45 AM