Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Strengthening Flow Types for Core Components #22100
We want to tighten the Flow types of the props for our core components. We need the help of the community to comb through these files and improve these types.
Right now a lot of props are typed using
Many of these types are used to validate what we send to native. If JS defines a function that expects a string but Native calls it with a number, applications can crash.
We'd like to fix that by removing all references to
If your are able to remove all of these weak types from the file, try to change
How to submit quality PRs
Since many of these weak types are used at the boundary between JS and native, you will likely need to read through the native code for these components to see how these props are being used. Unfortunately, Flow will likely pass with invalid types. Paying close attention to what iOS and Android expects will be helpful to ensure the types are accurate.
I also urge those that submit PRs for this to help out with reviewing the PRs for this issue from other contributors. Code review is a great opportunity to learn and improve your own code as well as make sure everyone is on the same page and consistent. If you find tips that would have helped you investigate and improve the types, commenting on this issue with those tips would be appreciated. Help each other.
Also note that since you are improving these types you will likely help catch a bunch of bugs at Facebook (and elsewhere) where code isn't handling the types correctly. This means that PRs will likely take longer to land then the other issues like this we have asked for help on. This is a good thing, it is direct impact on the stability of React Native projects and catching bugs.
The following is a list of files that I'd like to address first. If you want to take one of these files please comment on this issue with the file name so that others don't work on it as well and waste work. There are plenty of files to go around.
All the warnings for these files: