Skip to content

Commit

Permalink
Revise Prop Types Error Message (#34392)
Browse files Browse the repository at this point in the history
Summary:
Improves upon the existing prop types error messages to first recommend migrating to a type system (before recommending the usage of `deprecated-react-native-prop-types`).

## Changelog

[General][Changed] - Minor change to PropTypes error message.

Pull Request resolved: #34392

Test Plan: Careful code inspection.

Reviewed By: rickhanlonii

Differential Revision: D38632723

Pulled By: yungsters

fbshipit-source-id: 88e44116475c7d93bc561c9ab6883855d6d79a7e
  • Loading branch information
yungsters authored and facebook-github-bot committed Aug 11, 2022
1 parent ffaa1a6 commit 7783f88
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,29 +427,41 @@ module.exports = {
get ColorPropType(): $FlowFixMe {
invariant(
false,
'ColorPropType has been removed from React Native. Migrate to ' +
"ColorPropType exported from 'deprecated-react-native-prop-types'.",
'ColorPropType has been removed from React Native, along with all ' +
'other PropTypes. We recommend that you migrate away from PropTypes ' +
'and switch to a type system like TypeScript. If you need to ' +
'continue using ColorPropType, migrate to the ' +
"'deprecated-react-native-prop-types' package.",
);
},
get EdgeInsetsPropType(): $FlowFixMe {
invariant(
false,
'EdgeInsetsPropType has been removed from React Native. Migrate to ' +
"EdgeInsetsPropType exported from 'deprecated-react-native-prop-types'.",
'EdgeInsetsPropType has been removed from React Native, along with all ' +
'other PropTypes. We recommend that you migrate away from PropTypes ' +
'and switch to a type system like TypeScript. If you need to ' +
'continue using EdgeInsetsPropType, migrate to the ' +
"'deprecated-react-native-prop-types' package.",
);
},
get PointPropType(): $FlowFixMe {
invariant(
false,
'PointPropType has been removed from React Native. Migrate to ' +
"PointPropType exported from 'deprecated-react-native-prop-types'.",
'PointPropType has been removed from React Native, along with all ' +
'other PropTypes. We recommend that you migrate away from PropTypes ' +
'and switch to a type system like TypeScript. If you need to ' +
'continue using PointPropType, migrate to the ' +
"'deprecated-react-native-prop-types' package.",
);
},
get ViewPropTypes(): $FlowFixMe {
invariant(
false,
'ViewPropTypes has been removed from React Native. Migrate to ' +
"ViewPropTypes exported from 'deprecated-react-native-prop-types'.",
'ViewPropTypes has been removed from React Native, along with all ' +
'other PropTypes. We recommend that you migrate away from PropTypes ' +
'and switch to a type system like TypeScript. If you need to ' +
'continue using ViewPropTypes, migrate to the ' +
"'deprecated-react-native-prop-types' package.",
);
},
};
Expand Down

0 comments on commit 7783f88

Please sign in to comment.