-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Removing propTypes from core components #21342
Copy link
Copy link
Closed
Labels
Good first issueInterested in collaborating? Take a stab at fixing one of these issues.Interested in collaborating? Take a stab at fixing one of these issues.Help Wanted
Issues ideal for external contributors.Issues ideal for external contributors.JavaScriptResolution: LockedThis issue was locked by the bot.This issue was locked by the bot.
Metadata
Metadata
Assignees
Labels
Good first issueInterested in collaborating? Take a stab at fixing one of these issues.Interested in collaborating? Take a stab at fixing one of these issues.Help Wanted
Issues ideal for external contributors.Issues ideal for external contributors.JavaScriptResolution: LockedThis issue was locked by the bot.This issue was locked by the bot.
Type
Fields
Give feedbackNo fields configured for issues without a type.
We have been using Flow for our components for a long while and have enjoyed much stricter type safety, enabling us to validate our code at compile time instead of with propTypes at runtime. We want to replace the remaining callsites of propTypes with Flow and deprecate the propType shapes exposed by React Native core. To do this, we need your help!
This is step 1 of our multi step goal. Step 2 can be found here.
There are two classes of things that need to happen to complete this work. The first step is removing references from propTypes in our core components. The following are the individual files that need to be converted / updated. Each file should be converted in its own PR and each file is about the size of a good first issue to learn and get familiar with a part of the React Native codebase. If you’d like to convert one, pick one from the list, comment on this issue that you are interested in converting it, and follow the tips in @empyrical's comment for help successfully updating that file.
Remove callsites from components:
Move and Rename custom
propTypedefinitionsFor these, I think we should create a new folder,
react-native/Libraries/DeprecatedPropTypes. Many of these files have both the Flow definition and the propTypes definition. "Split" means split these into two files, in the example ofEdgeInsetsPropTypeit would mean having anEdgeInsetsPropType.jsfile that contains the commented flow types, and aDeprecatedEdgeInsetsPropType.jsfile inside theDeprecatedPropTypesfolder. Eventually that folder will become the source for the new repo that we move out.