HomePhabricator
Diffusion Comm b30942ea3e82

[Flow202][native][skip-ci] [4/x] Stop copy-pasting between ReactNav libdefs

Description

[Flow202][native][skip-ci] [4/x] Stop copy-pasting between ReactNav libdefs

Summary:
In the past flow-typed did not allow importing from other libdefs, so we needed to copy-paste between React Navigation libdefs. This has been challenging because Flow is not always able to realize that the types match up. The new version of Flow was seeing a lot more errors due to issues matching up the copy-pasted types.

In this diff, we eliminate all copy-paste between these libdefs, opting instead to import from the @react-navigation/core libdef. This means that all types must now be sourced from @react-navigation/core, which necessitated some additional export declarations there, and a whole lot of changes to imports.

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 D9987

Test Plan: Confirm the Flow errors go away

Reviewers: tomek

Reviewed By: tomek

Differential Revision: https://phab.comm.dev/D9988

Details