mirror of
https://github.com/facebook/react-native.git
synced 2024-11-21 22:10:14 +00:00
RN: Remove Deprecated Prop Types (#42019)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/42019 Removes the following deprecated properties from React Native: - `Image.propTypes` - `Text.propTypes` - `TextInput.propTypes` - `ColorPropType` - `EdgeInsetsPropType` - `PointPropType` - `ViewPropTypes` The deprecation history for these prop types is not super obvious, so here is a summary: - `react@15.5` extracted `prop-types` into a separate package to reflect that not everybody uses them. - `react-native@0.68` added a deprecation warning to built-in prop types. (3f629049ba
) - `react-native@0.69` removed built-in prop types. (3e229f27bc
) - `react-native@0.71` restored built-in prop types, along with bug fixes to isolate deprecated usage. (b966d29724
) We believe that by the next public release, enough time will have passed for the community to be able to upgrade without patching React Native or otherwise working around the removal of these deprecated prop types. **If anyone has trouble identifying the source of a deleted prop types usage, please file an issue so we can help track it down with you.** Changelog: [General][Removed] - Removed deprecated prop types Reviewed By: lunaleaps, NickGerleman Differential Revision: D52337762 fbshipit-source-id: 9731f7e1dec29f3df535ab75cc50bed001fdfa0b
This commit is contained in:
parent
2b63b9bba9
commit
228cb80af9
@ -15,11 +15,6 @@ uplinks:
|
||||
maxSockets: 40
|
||||
maxFreeSockets: 10
|
||||
packages:
|
||||
# Get @react-native/normalize-colors from npm registry, since its used in deprecated-react-native-prop-types package
|
||||
'@react-native/normalize-colors':
|
||||
access: $all
|
||||
publish: $authenticated
|
||||
proxy: npmjs
|
||||
# Group and isolate all local packages, avoid being proxy from outside
|
||||
'@react-native/*':
|
||||
access: $all
|
||||
|
@ -1752,13 +1752,6 @@ const ExportedForwardRef: React.AbstractComponent<
|
||||
|
||||
ExportedForwardRef.displayName = 'TextInput';
|
||||
|
||||
/**
|
||||
* Switch to `deprecated-react-native-prop-types` for compatibility with future
|
||||
* releases. This is deprecated and will be removed in the future.
|
||||
*/
|
||||
ExportedForwardRef.propTypes =
|
||||
require('deprecated-react-native-prop-types').TextInputPropTypes;
|
||||
|
||||
// $FlowFixMe[prop-missing]
|
||||
ExportedForwardRef.State = {
|
||||
currentlyFocusedInput: TextInputState.currentlyFocusedInput,
|
||||
|
@ -312,12 +312,6 @@ Image.queryCache = queryCache;
|
||||
// $FlowFixMe[incompatible-use] This property isn't writable but we're actually defining it here for the first time.
|
||||
Image.resolveAssetSource = resolveAssetSource;
|
||||
|
||||
/**
|
||||
* Switch to `deprecated-react-native-prop-types` for compatibility with future
|
||||
* releases. This is deprecated and will be removed in the future.
|
||||
*/
|
||||
Image.propTypes = require('deprecated-react-native-prop-types').ImagePropTypes;
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
base: {
|
||||
overflow: 'hidden',
|
||||
|
@ -246,12 +246,6 @@ Image.queryCache = queryCache;
|
||||
// $FlowFixMe[incompatible-use] This property isn't writable but we're actually defining it here for the first time.
|
||||
Image.resolveAssetSource = resolveAssetSource;
|
||||
|
||||
/**
|
||||
* Switch to `deprecated-react-native-prop-types` for compatibility with future
|
||||
* releases. This is deprecated and will be removed in the future.
|
||||
*/
|
||||
Image.propTypes = require('deprecated-react-native-prop-types').ImagePropTypes;
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
base: {
|
||||
overflow: 'hidden',
|
||||
|
6
packages/react-native/Libraries/Text/Text.js
vendored
6
packages/react-native/Libraries/Text/Text.js
vendored
@ -286,12 +286,6 @@ const Text: React.AbstractComponent<
|
||||
|
||||
Text.displayName = 'Text';
|
||||
|
||||
/**
|
||||
* Switch to `deprecated-react-native-prop-types` for compatibility with future
|
||||
* releases. This is deprecated and will be removed in the future.
|
||||
*/
|
||||
Text.propTypes = require('deprecated-react-native-prop-types').TextPropTypes;
|
||||
|
||||
/**
|
||||
* Returns false until the first time `newValue` is true, after which this will
|
||||
* always return true. This is necessary to lazily initialize `Pressability` so
|
||||
|
41
packages/react-native/index.js
vendored
41
packages/react-native/index.js
vendored
@ -375,47 +375,6 @@ module.exports = {
|
||||
'LogBox is enabled by default so there is no need to call unstable_enableLogBox() anymore. This is a no op and will be removed in the next version.',
|
||||
);
|
||||
},
|
||||
// Deprecated Prop Types
|
||||
get ColorPropType(): $FlowFixMe {
|
||||
console.error(
|
||||
'ColorPropType will be 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.",
|
||||
);
|
||||
return require('deprecated-react-native-prop-types').ColorPropType;
|
||||
},
|
||||
get EdgeInsetsPropType(): $FlowFixMe {
|
||||
console.error(
|
||||
'EdgeInsetsPropType will be 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.",
|
||||
);
|
||||
return require('deprecated-react-native-prop-types').EdgeInsetsPropType;
|
||||
},
|
||||
get PointPropType(): $FlowFixMe {
|
||||
console.error(
|
||||
'PointPropType will be 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.",
|
||||
);
|
||||
return require('deprecated-react-native-prop-types').PointPropType;
|
||||
},
|
||||
get ViewPropTypes(): $FlowFixMe {
|
||||
console.error(
|
||||
'ViewPropTypes will be 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.",
|
||||
);
|
||||
return require('deprecated-react-native-prop-types').ViewPropTypes;
|
||||
},
|
||||
};
|
||||
|
||||
if (__DEV__) {
|
||||
|
@ -109,7 +109,6 @@
|
||||
"anser": "^1.4.9",
|
||||
"ansi-regex": "^5.0.0",
|
||||
"base64-js": "^1.5.1",
|
||||
"deprecated-react-native-prop-types": "^5.0.0",
|
||||
"event-target-shim": "^5.0.1",
|
||||
"flow-enums-runtime": "^0.0.6",
|
||||
"invariant": "^2.2.4",
|
||||
|
14
yarn.lock
14
yarn.lock
@ -2537,11 +2537,6 @@
|
||||
prompts "^2.4.2"
|
||||
semver "^7.5.2"
|
||||
|
||||
"@react-native/normalize-colors@^0.73.0":
|
||||
version "0.73.2"
|
||||
resolved "https://registry.yarnpkg.com/@react-native/normalize-colors/-/normalize-colors-0.73.2.tgz#cc8e48fbae2bbfff53e12f209369e8d2e4cf34ec"
|
||||
integrity sha512-bRBcb2T+I88aG74LMVHaKms2p/T8aQd8+BZ7LuuzXlRfog1bMWWn/C5i0HVuvW4RPtXQYgIlGiXVDy9Ir1So/w==
|
||||
|
||||
"@rnx-kit/chromium-edge-launcher@^1.0.0":
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@rnx-kit/chromium-edge-launcher/-/chromium-edge-launcher-1.0.0.tgz#c0df8ea00a902c7a417cd9655aab06de398b939c"
|
||||
@ -4333,15 +4328,6 @@ depd@2.0.0:
|
||||
resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df"
|
||||
integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==
|
||||
|
||||
deprecated-react-native-prop-types@^5.0.0:
|
||||
version "5.0.0"
|
||||
resolved "https://registry.yarnpkg.com/deprecated-react-native-prop-types/-/deprecated-react-native-prop-types-5.0.0.tgz#02a12f090da7bd9e8c3ac53c31cf786a1315d302"
|
||||
integrity sha512-cIK8KYiiGVOFsKdPMmm1L3tA/Gl+JopXL6F5+C7x39MyPsQYnP57Im/D6bNUzcborD7fcMwiwZqcBdBXXZucYQ==
|
||||
dependencies:
|
||||
"@react-native/normalize-colors" "^0.73.0"
|
||||
invariant "^2.2.4"
|
||||
prop-types "^15.8.1"
|
||||
|
||||
deprecation@^2.0.0, deprecation@^2.3.1:
|
||||
version "2.3.1"
|
||||
resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919"
|
||||
|
Loading…
Reference in New Issue
Block a user