Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

deprecated-react-native-prop-types

Package Overview
Dependencies
Maintainers
4
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deprecated-react-native-prop-types - npm Package Compare versions

Comparing version 1.1.0 to 2.0.0

7

DeprecatedColorPropType.js

@@ -12,3 +12,3 @@ /**

const normalizeColor = require('react-native/Libraries/StyleSheet/normalizeColor');
const normalizeColor = require('@react-native/normalize-color');

@@ -24,3 +24,4 @@ const colorPropType = function(

const color = props[propName];
if (color === undefined || color === null) {
if (color == null) {
if (isRequired) {

@@ -47,3 +48,3 @@ return new Error(

if (normalizeColor(color) === null) {
if (typeof color === 'string' && normalizeColor(color) === null) {
return new Error(

@@ -50,0 +51,0 @@ 'Invalid ' +

@@ -8,3 +8,2 @@ /**

* @format
* @flow
*/

@@ -16,6 +15,3 @@

function deprecatedCreateStrictShapeTypeChecker(shapeTypes: {
[key: string]: ReactPropsCheckType,
...,
}): ReactPropsChainableTypeChecker {
function deprecatedCreateStrictShapeTypeChecker(shapeTypes) {
function checkType(

@@ -26,3 +22,3 @@ isRequired,

componentName,
location?,
location,
...rest

@@ -76,9 +72,3 @@ ) {

}
function chainedCheckType(
props: {[key: string]: any, ...},
propName: string,
componentName: string,
location?: string,
...rest
): ?Error {
function chainedCheckType(props, propName, componentName, location, ...rest) {
return checkType(false, props, propName, componentName, location, ...rest);

@@ -85,0 +75,0 @@ }

@@ -8,3 +8,2 @@ /**

* @format
* @flow strict
*/

@@ -16,9 +15,3 @@

const DeprecatedEdgeInsetsPropType: React$PropType$Primitive<{
bottom?: number,
left?: number,
right?: number,
top?: number,
...
}> = PropTypes.shape({
const DeprecatedEdgeInsetsPropType = PropTypes.shape({
top: PropTypes.number,

@@ -25,0 +18,0 @@ left: PropTypes.number,

@@ -7,3 +7,2 @@ /**

*
* @flow
* @format

@@ -21,9 +20,7 @@ */

...DeprecatedViewPropTypes,
style: (DeprecatedStyleSheetPropType(
DeprecatedImageStylePropTypes,
): ReactPropsCheckType),
style: DeprecatedStyleSheetPropType(DeprecatedImageStylePropTypes),
/**
* See https://reactnative.dev/docs/image.html#source
*/
source: (PropTypes.oneOfType([
source: PropTypes.oneOfType([
PropTypes.shape({

@@ -44,17 +41,3 @@ uri: PropTypes.string,

),
]): React$PropType$Primitive<
| {
headers?: {[string]: string, ...},
uri?: string,
...
}
| number
| Array<{
headers?: {[string]: string, ...},
height?: number,
uri?: string,
width?: number,
...
}>,
>),
]),
/**

@@ -73,3 +56,3 @@ * blurRadius: the blur radius of the blur filter added to the image

*/
loadingIndicatorSource: (PropTypes.oneOfType([
loadingIndicatorSource: PropTypes.oneOfType([
PropTypes.shape({

@@ -80,3 +63,3 @@ uri: PropTypes.string,

PropTypes.number,
]): React$PropType$Primitive<{uri?: string, ...} | number>),
]),
progressiveRenderingEnabled: PropTypes.bool,

@@ -114,7 +97,3 @@ fadeDuration: PropTypes.number,

*/
resizeMethod: (PropTypes.oneOf([
'auto',
'resize',
'scale',
]): React$PropType$Primitive<'auto' | 'resize' | 'scale'>),
resizeMethod: PropTypes.oneOf(['auto', 'resize', 'scale']),
/**

@@ -126,3 +105,3 @@ * Determines how to resize the image when the frame doesn't match the raw

*/
resizeMode: (PropTypes.oneOf([
resizeMode: PropTypes.oneOf([
'cover',

@@ -133,7 +112,5 @@ 'contain',

'center',
]): React$PropType$Primitive<
'cover' | 'contain' | 'stretch' | 'repeat' | 'center',
>),
]),
};
module.exports = DeprecatedImagePropType;

@@ -7,3 +7,2 @@ /**

*
* @flow
* @format

@@ -21,7 +20,5 @@ */

module.exports = {
style: (DeprecatedStyleSheetPropType(
DeprecatedImageStylePropTypes,
): ReactPropsCheckType),
style: DeprecatedStyleSheetPropType(DeprecatedImageStylePropTypes),
source: DeprecatedImageSourcePropType,
defaultSource: (PropTypes.oneOfType([
defaultSource: PropTypes.oneOfType([
PropTypes.shape({

@@ -34,12 +31,3 @@ uri: PropTypes.string,

PropTypes.number,
]): React$PropType$Primitive<
| {
height?: number,
scale?: number,
uri?: string,
width?: number,
...
}
| number,
>),
]),

@@ -54,9 +42,5 @@ accessible: PropTypes.bool,

resizeMethod: (PropTypes.oneOf([
'auto',
'resize',
'scale',
]): React$PropType$Primitive<'auto' | 'resize' | 'scale'>),
resizeMethod: PropTypes.oneOf(['auto', 'resize', 'scale']),
resizeMode: (PropTypes.oneOf([
resizeMode: PropTypes.oneOf([
'cover',

@@ -67,5 +51,3 @@ 'contain',

'center',
]): React$PropType$Primitive<
'cover' | 'contain' | 'stretch' | 'repeat' | 'center',
>),
]),

@@ -72,0 +54,0 @@ testID: PropTypes.string,

@@ -7,3 +7,2 @@ /**

*
* @no-flow
* @format

@@ -10,0 +9,0 @@ */

@@ -7,3 +7,2 @@ /**

*
* @flow
* @format

@@ -24,3 +23,3 @@ */

...DeprecatedTransformPropTypes,
resizeMode: (ReactPropTypes.oneOf([
resizeMode: ReactPropTypes.oneOf([
'center',

@@ -31,9 +30,4 @@ 'contain',

'stretch',
]): React$PropType$Primitive<
'center' | 'contain' | 'cover' | 'repeat' | 'stretch',
>),
backfaceVisibility: (ReactPropTypes.oneOf([
'visible',
'hidden',
]): React$PropType$Primitive<'visible' | 'hidden'>),
]),
backfaceVisibility: ReactPropTypes.oneOf(['visible', 'hidden']),
backgroundColor: DeprecatedColorPropType,

@@ -43,6 +37,3 @@ borderColor: DeprecatedColorPropType,

borderRadius: ReactPropTypes.number,
overflow: (ReactPropTypes.oneOf([
'visible',
'hidden',
]): React$PropType$Primitive<'visible' | 'hidden'>),
overflow: ReactPropTypes.oneOf(['visible', 'hidden']),

@@ -49,0 +40,0 @@ /**

@@ -8,3 +8,2 @@ /**

* @format
* @flow strict
*/

@@ -17,125 +16,117 @@

const LayoutPropTypes = {
display: (ReactPropTypes.oneOf(['none', 'flex']): React$PropType$Primitive<
'none' | 'flex',
>),
width: (ReactPropTypes.oneOfType([
display: ReactPropTypes.oneOf(['none', 'flex']),
width: ReactPropTypes.oneOfType([
ReactPropTypes.number,
ReactPropTypes.string,
]): React$PropType$Primitive<number | string>),
height: (ReactPropTypes.oneOfType([
]),
height: ReactPropTypes.oneOfType([
ReactPropTypes.number,
ReactPropTypes.string,
]): React$PropType$Primitive<number | string>),
start: (ReactPropTypes.oneOfType([
]),
start: ReactPropTypes.oneOfType([
ReactPropTypes.number,
ReactPropTypes.string,
]): React$PropType$Primitive<number | string>),
end: (ReactPropTypes.oneOfType([
]),
end: ReactPropTypes.oneOfType([ReactPropTypes.number, ReactPropTypes.string]),
top: ReactPropTypes.oneOfType([ReactPropTypes.number, ReactPropTypes.string]),
left: ReactPropTypes.oneOfType([
ReactPropTypes.number,
ReactPropTypes.string,
]): React$PropType$Primitive<number | string>),
top: (ReactPropTypes.oneOfType([
]),
right: ReactPropTypes.oneOfType([
ReactPropTypes.number,
ReactPropTypes.string,
]): React$PropType$Primitive<number | string>),
left: (ReactPropTypes.oneOfType([
]),
bottom: ReactPropTypes.oneOfType([
ReactPropTypes.number,
ReactPropTypes.string,
]): React$PropType$Primitive<number | string>),
right: (ReactPropTypes.oneOfType([
]),
minWidth: ReactPropTypes.oneOfType([
ReactPropTypes.number,
ReactPropTypes.string,
]): React$PropType$Primitive<number | string>),
bottom: (ReactPropTypes.oneOfType([
]),
maxWidth: ReactPropTypes.oneOfType([
ReactPropTypes.number,
ReactPropTypes.string,
]): React$PropType$Primitive<number | string>),
minWidth: (ReactPropTypes.oneOfType([
]),
minHeight: ReactPropTypes.oneOfType([
ReactPropTypes.number,
ReactPropTypes.string,
]): React$PropType$Primitive<number | string>),
maxWidth: (ReactPropTypes.oneOfType([
]),
maxHeight: ReactPropTypes.oneOfType([
ReactPropTypes.number,
ReactPropTypes.string,
]): React$PropType$Primitive<number | string>),
minHeight: (ReactPropTypes.oneOfType([
]),
margin: ReactPropTypes.oneOfType([
ReactPropTypes.number,
ReactPropTypes.string,
]): React$PropType$Primitive<number | string>),
maxHeight: (ReactPropTypes.oneOfType([
]),
marginVertical: ReactPropTypes.oneOfType([
ReactPropTypes.number,
ReactPropTypes.string,
]): React$PropType$Primitive<number | string>),
margin: (ReactPropTypes.oneOfType([
]),
marginHorizontal: ReactPropTypes.oneOfType([
ReactPropTypes.number,
ReactPropTypes.string,
]): React$PropType$Primitive<number | string>),
marginVertical: (ReactPropTypes.oneOfType([
]),
marginTop: ReactPropTypes.oneOfType([
ReactPropTypes.number,
ReactPropTypes.string,
]): React$PropType$Primitive<number | string>),
marginHorizontal: (ReactPropTypes.oneOfType([
]),
marginBottom: ReactPropTypes.oneOfType([
ReactPropTypes.number,
ReactPropTypes.string,
]): React$PropType$Primitive<number | string>),
marginTop: (ReactPropTypes.oneOfType([
]),
marginLeft: ReactPropTypes.oneOfType([
ReactPropTypes.number,
ReactPropTypes.string,
]): React$PropType$Primitive<number | string>),
marginBottom: (ReactPropTypes.oneOfType([
]),
marginRight: ReactPropTypes.oneOfType([
ReactPropTypes.number,
ReactPropTypes.string,
]): React$PropType$Primitive<number | string>),
marginLeft: (ReactPropTypes.oneOfType([
]),
marginStart: ReactPropTypes.oneOfType([
ReactPropTypes.number,
ReactPropTypes.string,
]): React$PropType$Primitive<number | string>),
marginRight: (ReactPropTypes.oneOfType([
]),
marginEnd: ReactPropTypes.oneOfType([
ReactPropTypes.number,
ReactPropTypes.string,
]): React$PropType$Primitive<number | string>),
marginStart: (ReactPropTypes.oneOfType([
]),
padding: ReactPropTypes.oneOfType([
ReactPropTypes.number,
ReactPropTypes.string,
]): React$PropType$Primitive<number | string>),
marginEnd: (ReactPropTypes.oneOfType([
]),
paddingVertical: ReactPropTypes.oneOfType([
ReactPropTypes.number,
ReactPropTypes.string,
]): React$PropType$Primitive<number | string>),
padding: (ReactPropTypes.oneOfType([
]),
paddingHorizontal: ReactPropTypes.oneOfType([
ReactPropTypes.number,
ReactPropTypes.string,
]): React$PropType$Primitive<number | string>),
paddingVertical: (ReactPropTypes.oneOfType([
]),
paddingTop: ReactPropTypes.oneOfType([
ReactPropTypes.number,
ReactPropTypes.string,
]): React$PropType$Primitive<number | string>),
paddingHorizontal: (ReactPropTypes.oneOfType([
]),
paddingBottom: ReactPropTypes.oneOfType([
ReactPropTypes.number,
ReactPropTypes.string,
]): React$PropType$Primitive<number | string>),
paddingTop: (ReactPropTypes.oneOfType([
]),
paddingLeft: ReactPropTypes.oneOfType([
ReactPropTypes.number,
ReactPropTypes.string,
]): React$PropType$Primitive<number | string>),
paddingBottom: (ReactPropTypes.oneOfType([
]),
paddingRight: ReactPropTypes.oneOfType([
ReactPropTypes.number,
ReactPropTypes.string,
]): React$PropType$Primitive<number | string>),
paddingLeft: (ReactPropTypes.oneOfType([
]),
paddingStart: ReactPropTypes.oneOfType([
ReactPropTypes.number,
ReactPropTypes.string,
]): React$PropType$Primitive<number | string>),
paddingRight: (ReactPropTypes.oneOfType([
]),
paddingEnd: ReactPropTypes.oneOfType([
ReactPropTypes.number,
ReactPropTypes.string,
]): React$PropType$Primitive<number | string>),
paddingStart: (ReactPropTypes.oneOfType([
ReactPropTypes.number,
ReactPropTypes.string,
]): React$PropType$Primitive<number | string>),
paddingEnd: (ReactPropTypes.oneOfType([
ReactPropTypes.number,
ReactPropTypes.string,
]): React$PropType$Primitive<number | string>),
]),
borderWidth: ReactPropTypes.number,

@@ -148,7 +139,4 @@ borderTopWidth: ReactPropTypes.number,

borderLeftWidth: ReactPropTypes.number,
position: (ReactPropTypes.oneOf([
'absolute',
'relative',
]): React$PropType$Primitive<'absolute' | 'relative'>),
flexDirection: (ReactPropTypes.oneOf([
position: ReactPropTypes.oneOf(['absolute', 'relative']),
flexDirection: ReactPropTypes.oneOf([
'row',

@@ -158,11 +146,5 @@ 'row-reverse',

'column-reverse',
]): React$PropType$Primitive<
'row' | 'row-reverse' | 'column' | 'column-reverse',
>),
flexWrap: (ReactPropTypes.oneOf([
'wrap',
'nowrap',
'wrap-reverse',
]): React$PropType$Primitive<'wrap' | 'nowrap' | 'wrap-reverse'>),
justifyContent: (ReactPropTypes.oneOf([
]),
flexWrap: ReactPropTypes.oneOf(['wrap', 'nowrap', 'wrap-reverse']),
justifyContent: ReactPropTypes.oneOf([
'flex-start',

@@ -174,11 +156,4 @@ 'flex-end',

'space-evenly',
]): React$PropType$Primitive<
| 'flex-start'
| 'flex-end'
| 'center'
| 'space-between'
| 'space-around'
| 'space-evenly',
>),
alignItems: (ReactPropTypes.oneOf([
]),
alignItems: ReactPropTypes.oneOf([
'flex-start',

@@ -189,6 +164,4 @@ 'flex-end',

'baseline',
]): React$PropType$Primitive<
'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline',
>),
alignSelf: (ReactPropTypes.oneOf([
]),
alignSelf: ReactPropTypes.oneOf([
'auto',

@@ -200,6 +173,4 @@ 'flex-start',

'baseline',
]): React$PropType$Primitive<
'auto' | 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline',
>),
alignContent: (ReactPropTypes.oneOf([
]),
alignContent: ReactPropTypes.oneOf([
'flex-start',

@@ -211,31 +182,16 @@ 'flex-end',

'space-around',
]): React$PropType$Primitive<
| 'flex-start'
| 'flex-end'
| 'center'
| 'stretch'
| 'space-between'
| 'space-around',
>),
overflow: (ReactPropTypes.oneOf([
'visible',
'hidden',
'scroll',
]): React$PropType$Primitive<'visible' | 'hidden' | 'scroll'>),
]),
overflow: ReactPropTypes.oneOf(['visible', 'hidden', 'scroll']),
flex: ReactPropTypes.number,
flexGrow: ReactPropTypes.number,
flexShrink: ReactPropTypes.number,
flexBasis: (ReactPropTypes.oneOfType([
flexBasis: ReactPropTypes.oneOfType([
ReactPropTypes.number,
ReactPropTypes.string,
]): React$PropType$Primitive<number | string>),
]),
aspectRatio: ReactPropTypes.number,
zIndex: ReactPropTypes.number,
direction: (ReactPropTypes.oneOf([
'inherit',
'ltr',
'rtl',
]): React$PropType$Primitive<'inherit' | 'ltr' | 'rtl'>),
direction: ReactPropTypes.oneOf(['inherit', 'ltr', 'rtl']),
};
module.exports = LayoutPropTypes;

@@ -8,3 +8,2 @@ /**

* @format
* @flow strict
*/

@@ -16,7 +15,3 @@

const PointPropType: React$PropType$Primitive<{
x?: number,
y?: number,
...
}> = PropTypes.shape({
const PointPropType = PropTypes.shape({
x: PropTypes.number,

@@ -23,0 +18,0 @@ y: PropTypes.number,

@@ -7,3 +7,2 @@ /**

*
* @flow
* @format

@@ -19,10 +18,6 @@ */

shadowColor: DeprecatedColorPropType,
shadowOffset: (ReactPropTypes.shape({
shadowOffset: ReactPropTypes.shape({
width: ReactPropTypes.number,
height: ReactPropTypes.number,
}): React$PropType$Primitive<{
height?: number,
width?: number,
...
}>),
}),
shadowOpacity: ReactPropTypes.number,

@@ -29,0 +24,0 @@ shadowRadius: ReactPropTypes.number,

@@ -8,3 +8,2 @@ /**

* @format
* @flow strict-local
*/

@@ -15,10 +14,6 @@

const deprecatedCreateStrictShapeTypeChecker = require('./deprecatedCreateStrictShapeTypeChecker');
const flattenStyle = require('react-native/Libraries/StyleSheet/flattenStyle');
function DeprecatedStyleSheetPropType(shape: {
[key: string]: ReactPropsCheckType,
...,
}): ReactPropsCheckType {
function DeprecatedStyleSheetPropType(shape) {
const shapePropType = deprecatedCreateStrictShapeTypeChecker(shape);
return function(props, propName, componentName, location?, ...rest) {
return function(props, propName, componentName, location, ...rest) {
let newProps = props;

@@ -34,2 +29,23 @@ if (props[propName]) {

function flattenStyle(style) {
if (style === null || typeof style !== 'object') {
return undefined;
}
if (!Array.isArray(style)) {
return style;
}
const result = {};
for (let i = 0, styleLength = style.length; i < styleLength; ++i) {
const computedStyle = flattenStyle(style[i]);
if (computedStyle) {
for (const key in computedStyle) {
result[key] = computedStyle[key];
}
}
}
return result;
}
module.exports = DeprecatedStyleSheetPropType;

@@ -7,3 +7,2 @@ /**

*
* @flow
* @format

@@ -38,8 +37,3 @@ */

*/
autoCapitalize: (PropTypes.oneOf([
'none',
'sentences',
'words',
'characters',
]): React$PropType$Primitive<'none' | 'sentences' | 'words' | 'characters'>),
autoCapitalize: PropTypes.oneOf(['none', 'sentences', 'words', 'characters']),
/**

@@ -69,3 +63,3 @@ * Determines which content to suggest on auto complete, e.g.`username`.

*/
autoCompleteType: (PropTypes.oneOf([
autoCompleteType: PropTypes.oneOf([
'cc-csc',

@@ -84,17 +78,3 @@ 'cc-exp',

'off',
]): React$PropType$Primitive<
| 'cc-csc'
| 'cc-exp'
| 'cc-exp-month'
| 'cc-exp-year'
| 'cc-number'
| 'email'
| 'name'
| 'password'
| 'postal-code'
| 'street-address'
| 'tel'
| 'username'
| 'off',
>),
]),
/**

@@ -162,3 +142,3 @@ * If `false`, disables auto-correct. The default value is `true`.

*/
keyboardType: (PropTypes.oneOf([
keyboardType: PropTypes.oneOf([
// Cross-platform

@@ -182,18 +162,3 @@ 'default',

'visible-password',
]): React$PropType$Primitive<
| 'default'
| 'email-address'
| 'numeric'
| 'phone-pad'
| 'number-pad'
| 'ascii-capable'
| 'numbers-and-punctuation'
| 'url'
| 'name-phone-pad'
| 'decimal-pad'
| 'twitter'
| 'web-search'
| 'ascii-capable-number-pad'
| 'visible-password',
>),
]),
/**

@@ -203,7 +168,3 @@ * Determines the color of the keyboard.

*/
keyboardAppearance: (PropTypes.oneOf([
'default',
'light',
'dark',
]): React$PropType$Primitive<'default' | 'light' | 'dark'>),
keyboardAppearance: PropTypes.oneOf(['default', 'light', 'dark']),
/**

@@ -241,3 +202,3 @@ * Determines how the return key should look. On Android you can also use

*/
returnKeyType: (PropTypes.oneOf([
returnKeyType: PropTypes.oneOf([
// Cross-platform

@@ -259,17 +220,3 @@ 'done',

'yahoo',
]): React$PropType$Primitive<
| 'done'
| 'go'
| 'next'
| 'search'
| 'send'
| 'none'
| 'previous'
| 'default'
| 'emergency-call'
| 'google'
| 'join'
| 'route'
| 'yahoo',
>),
]),
/**

@@ -316,7 +263,3 @@ * Sets the return key to the label. Use it instead of `returnKeyType`.

*/
textBreakStrategy: (PropTypes.oneOf([
'simple',
'highQuality',
'balanced',
]): React$PropType$Primitive<'simple' | 'highQuality' | 'balanced'>),
textBreakStrategy: PropTypes.oneOf(['simple', 'highQuality', 'balanced']),
/**

@@ -408,10 +351,6 @@ * Callback that is called when the text input is blurred.

*/
selection: (PropTypes.shape({
selection: PropTypes.shape({
start: PropTypes.number.isRequired,
end: PropTypes.number,
}): React$PropType$Primitive<{
end?: number,
start: number,
...
}>),
}),
/**

@@ -438,3 +377,3 @@ * The value to show for the text input. `TextInput` is a controlled

*/
clearButtonMode: (PropTypes.oneOf([
clearButtonMode: PropTypes.oneOf([
'never',

@@ -444,5 +383,3 @@ 'while-editing',

'always',
]): React$PropType$Primitive<
'never' | 'while-editing' | 'unless-editing' | 'always',
>),
]),
/**

@@ -482,3 +419,2 @@ * If `true`, clears the text field automatically when editing begins.

*/
// $FlowFixMe[incompatible-use]
style: DeprecatedTextPropTypes.style,

@@ -537,16 +473,6 @@ /**

*/
dataDetectorTypes: (PropTypes.oneOfType([
dataDetectorTypes: PropTypes.oneOfType([
PropTypes.oneOf(DataDetectorTypes),
PropTypes.arrayOf(PropTypes.oneOf(DataDetectorTypes)),
]): React$PropType$Primitive<
| 'phoneNumber'
| 'link'
| 'address'
| 'calendarEvent'
| 'none'
| 'all'
| Array<
'phoneNumber' | 'link' | 'address' | 'calendarEvent' | 'none' | 'all',
>,
>),
]),
/**

@@ -573,3 +499,3 @@ * If `true`, caret is hidden. The default value is `false`.

*/
textContentType: (PropTypes.oneOf([
textContentType: PropTypes.oneOf([
'none',

@@ -603,32 +529,3 @@ 'URL',

'oneTimeCode',
]): React$PropType$Primitive<
| 'none'
| 'URL'
| 'addressCity'
| 'addressCityAndState'
| 'addressState'
| 'countryName'
| 'creditCardNumber'
| 'emailAddress'
| 'familyName'
| 'fullStreetAddress'
| 'givenName'
| 'jobTitle'
| 'location'
| 'middleName'
| 'name'
| 'namePrefix'
| 'nameSuffix'
| 'nickname'
| 'organizationName'
| 'postalCode'
| 'streetAddressLine1'
| 'streetAddressLine2'
| 'sublocality'
| 'telephoneNumber'
| 'username'
| 'password'
| 'newPassword'
| 'oneTimeCode',
>),
]),
/**

@@ -635,0 +532,0 @@ * When `false`, it will prevent the soft keyboard from showing when the field is focused.

@@ -7,3 +7,2 @@ /**

*
* @flow
* @format

@@ -20,3 +19,3 @@ */

const stylePropType: ReactPropsCheckType = DeprecatedStyleSheetPropType(
const stylePropType = DeprecatedStyleSheetPropType(
DeprecatedTextStylePropTypes,

@@ -34,8 +33,3 @@ );

*/
ellipsizeMode: (PropTypes.oneOf([
'head',
'middle',
'tail',
'clip',
]): React$PropType$Primitive<'head' | 'middle' | 'tail' | 'clip'>),
ellipsizeMode: PropTypes.oneOf(['head', 'middle', 'tail', 'clip']),
/**

@@ -52,7 +46,3 @@ * Used to truncate the text with an ellipsis.

*/
textBreakStrategy: (PropTypes.oneOf([
'simple',
'highQuality',
'balanced',
]): React$PropType$Primitive<'simple' | 'highQuality' | 'balanced'>),
textBreakStrategy: PropTypes.oneOf(['simple', 'highQuality', 'balanced']),
/**

@@ -157,7 +147,3 @@ * Invoked on mount and layout changes.

*/
dataDetectorType: (PropTypes.oneOf(
DataDetectorTypes,
): React$PropType$Primitive<
'phoneNumber' | 'link' | 'email' | 'none' | 'all',
>),
dataDetectorType: PropTypes.oneOf(DataDetectorTypes),
};

@@ -8,3 +8,2 @@ /**

* @format
* @flow
*/

@@ -24,6 +23,3 @@

fontSize: ReactPropTypes.number,
fontStyle: (ReactPropTypes.oneOf([
'normal',
'italic',
]): React$PropType$Primitive<'normal' | 'italic'>),
fontStyle: ReactPropTypes.oneOf(['normal', 'italic']),
/**

@@ -34,3 +30,3 @@ * Specifies font weight. The values 'normal' and 'bold' are supported for

*/
fontWeight: (ReactPropTypes.oneOf([
fontWeight: ReactPropTypes.oneOf([
'normal' /*default*/,

@@ -47,16 +43,4 @@ 'bold',

'900',
]): React$PropType$Primitive<
| 'normal'
| 'bold'
| '100'
| '200'
| '300'
| '400'
| '500'
| '600'
| '700'
| '800'
| '900',
>),
fontVariant: (ReactPropTypes.arrayOf(
]),
fontVariant: ReactPropTypes.arrayOf(
ReactPropTypes.oneOf([

@@ -69,19 +53,7 @@ 'small-caps',

]),
): React$PropType$Primitive<
Array<
| 'small-caps'
| 'oldstyle-nums'
| 'lining-nums'
| 'tabular-nums'
| 'proportional-nums',
>,
>),
textShadowOffset: (ReactPropTypes.shape({
),
textShadowOffset: ReactPropTypes.shape({
width: ReactPropTypes.number,
height: ReactPropTypes.number,
}): React$PropType$Primitive<{
height?: number,
width?: number,
...
}>),
}),
textShadowRadius: ReactPropTypes.number,

@@ -98,3 +70,3 @@ textShadowColor: DeprecatedColorPropType,

*/
textAlign: (ReactPropTypes.oneOf([
textAlign: ReactPropTypes.oneOf([
'auto' /*default*/,

@@ -105,9 +77,7 @@ 'left',

'justify',
]): React$PropType$Primitive<
'auto' | 'left' | 'right' | 'center' | 'justify',
>),
]),
/**
* @platform android
*/
textAlignVertical: (ReactPropTypes.oneOf([
textAlignVertical: ReactPropTypes.oneOf([
'auto' /*default*/,

@@ -117,3 +87,3 @@ 'top',

'center',
]): React$PropType$Primitive<'auto' | 'top' | 'bottom' | 'center'>),
]),
/**

@@ -126,3 +96,3 @@ * Set to `false` to remove extra font padding intended to make space for certain ascenders / descenders.

includeFontPadding: ReactPropTypes.bool,
textDecorationLine: (ReactPropTypes.oneOf([
textDecorationLine: ReactPropTypes.oneOf([
'none' /*default*/,

@@ -132,9 +102,7 @@ 'underline',

'underline line-through',
]): React$PropType$Primitive<
'none' | 'underline' | 'line-through' | 'underline line-through',
>),
]),
/**
* @platform ios
*/
textDecorationStyle: (ReactPropTypes.oneOf([
textDecorationStyle: ReactPropTypes.oneOf([
'solid' /*default*/,

@@ -144,3 +112,3 @@ 'double',

'dashed',
]): React$PropType$Primitive<'solid' | 'double' | 'dotted' | 'dashed'>),
]),
/**

@@ -150,3 +118,3 @@ * @platform ios

textDecorationColor: DeprecatedColorPropType,
textTransform: (ReactPropTypes.oneOf([
textTransform: ReactPropTypes.oneOf([
'none' /*default*/,

@@ -156,15 +124,9 @@ 'capitalize',

'lowercase',
]): React$PropType$Primitive<
'none' | 'capitalize' | 'uppercase' | 'lowercase',
>),
]),
/**
* @platform ios
*/
writingDirection: (ReactPropTypes.oneOf([
'auto' /*default*/,
'ltr',
'rtl',
]): React$PropType$Primitive<'auto' | 'ltr' | 'rtl'>),
writingDirection: ReactPropTypes.oneOf(['auto' /*default*/, 'ltr', 'rtl']),
};
module.exports = DeprecatedTextStylePropTypes;

@@ -8,18 +8,13 @@ /**

* @format
* @flow
*/
"use strict";
'use strict';
const ReactPropTypes = require("prop-types");
const ReactPropTypes = require('prop-types');
const TransformMatrixPropType = function(
props: Object,
propName: string,
componentName: string
): ?Error {
const TransformMatrixPropType = function(props, propName, componentName) {
if (props[propName]) {
return new Error(
"The transformMatrix style property is deprecated. " +
"Use `transform: [{ matrix: ... }]` instead."
'The transformMatrix style property is deprecated. ' +
'Use `transform: [{ matrix: ... }]` instead.',
);

@@ -29,11 +24,7 @@ }

const DecomposedMatrixPropType = function(
props: Object,
propName: string,
componentName: string
): ?Error {
const DecomposedMatrixPropType = function(props, propName, componentName) {
if (props[propName]) {
return new Error(
"The decomposedMatrix style property is deprecated. " +
"Use `transform: [...]` instead."
'The decomposedMatrix style property is deprecated. ' +
'Use `transform: [...]` instead.',
);

@@ -44,55 +35,40 @@ }

const DeprecatedTransformPropTypes = {
transform: (ReactPropTypes.arrayOf(
transform: ReactPropTypes.arrayOf(
ReactPropTypes.oneOfType([
ReactPropTypes.shape({ perspective: ReactPropTypes.number }),
ReactPropTypes.shape({ rotate: ReactPropTypes.string }),
ReactPropTypes.shape({ rotateX: ReactPropTypes.string }),
ReactPropTypes.shape({ rotateY: ReactPropTypes.string }),
ReactPropTypes.shape({ rotateZ: ReactPropTypes.string }),
ReactPropTypes.shape({ scale: ReactPropTypes.number }),
ReactPropTypes.shape({ scaleX: ReactPropTypes.number }),
ReactPropTypes.shape({ scaleY: ReactPropTypes.number }),
ReactPropTypes.shape({ translateX: ReactPropTypes.number }),
ReactPropTypes.shape({ translateY: ReactPropTypes.number }),
ReactPropTypes.shape({ skewX: ReactPropTypes.string }),
ReactPropTypes.shape({ skewY: ReactPropTypes.string }),
])
): React$PropType$Primitive<
Array<
| { perspective?: number, ... }
| { rotate?: string, ... }
| { rotateX?: string, ... }
| { rotateY?: string, ... }
| { rotateZ?: string, ... }
| { scale?: number, ... }
| { scaleX?: number, ... }
| { scaleY?: number, ... }
| { translateX?: number, ... }
| { translateY?: number, ... }
| { skewX?: string, ... }
| { skewY?: string, ... }
>
>),
ReactPropTypes.shape({perspective: ReactPropTypes.number}),
ReactPropTypes.shape({rotate: ReactPropTypes.string}),
ReactPropTypes.shape({rotateX: ReactPropTypes.string}),
ReactPropTypes.shape({rotateY: ReactPropTypes.string}),
ReactPropTypes.shape({rotateZ: ReactPropTypes.string}),
ReactPropTypes.shape({scale: ReactPropTypes.number}),
ReactPropTypes.shape({scaleX: ReactPropTypes.number}),
ReactPropTypes.shape({scaleY: ReactPropTypes.number}),
ReactPropTypes.shape({translateX: ReactPropTypes.number}),
ReactPropTypes.shape({translateY: ReactPropTypes.number}),
ReactPropTypes.shape({skewX: ReactPropTypes.string}),
ReactPropTypes.shape({skewY: ReactPropTypes.string}),
]),
),
transformMatrix: TransformMatrixPropType,
decomposedMatrix: DecomposedMatrixPropType,
scaleX: (deprecatedPropType(
scaleX: deprecatedPropType(
ReactPropTypes.number,
"Use the transform prop instead."
): ReactPropsCheckType),
scaleY: (deprecatedPropType(
'Use the transform prop instead.',
),
scaleY: deprecatedPropType(
ReactPropTypes.number,
"Use the transform prop instead."
): ReactPropsCheckType),
rotation: (deprecatedPropType(
'Use the transform prop instead.',
),
rotation: deprecatedPropType(
ReactPropTypes.number,
"Use the transform prop instead."
): ReactPropsCheckType),
translateX: (deprecatedPropType(
'Use the transform prop instead.',
),
translateX: deprecatedPropType(
ReactPropTypes.number,
"Use the transform prop instead."
): ReactPropsCheckType),
translateY: (deprecatedPropType(
'Use the transform prop instead.',
),
translateY: deprecatedPropType(
ReactPropTypes.number,
"Use the transform prop instead."
): ReactPropsCheckType),
'Use the transform prop instead.',
),
};

@@ -103,9 +79,6 @@

*/
function deprecatedPropType(
propType: ReactPropsCheckType,
explanation: string
): ReactPropsCheckType {
function deprecatedPropType(propType, explanation) {
return function validate(props, propName, componentName, ...rest) {
console.warn(
`\`${propName}\` supplied to \`${componentName}\` has been deprecated. ${explanation}`
`\`${propName}\` supplied to \`${componentName}\` has been deprecated. ${explanation}`,
);

@@ -112,0 +85,0 @@

@@ -8,3 +8,2 @@ /**

* @format
* @flow strict
*/

@@ -11,0 +10,0 @@

@@ -8,3 +8,2 @@ /**

* @format
* @flow strict-local
*/

@@ -21,3 +20,3 @@

const stylePropType: ReactPropsCheckType = DeprecatedStyleSheetPropType(
const stylePropType = DeprecatedStyleSheetPropType(
DeprecatedViewStylePropTypes,

@@ -59,5 +58,3 @@ );

*/
accessibilityActions: (PropTypes.arrayOf(
PropTypes.string,
): React$PropType$Primitive<Array<string>>),
accessibilityActions: PropTypes.arrayOf(PropTypes.string),

@@ -74,33 +71,3 @@ /**

*/
accessibilityRole: (PropTypes.oneOf(
DeprecatedAccessibilityRoles,
): React$PropType$Primitive<
| 'none'
| 'button'
| 'link'
| 'search'
| 'image'
| 'keyboardkey'
| 'text'
| 'adjustable'
| 'imagebutton'
| 'header'
| 'summary'
| 'alert'
| 'checkbox'
| 'combobox'
| 'menu'
| 'menubar'
| 'menuitem'
| 'progressbar'
| 'radio'
| 'radiogroup'
| 'scrollbar'
| 'spinbutton'
| 'switch'
| 'tab'
| 'tablist'
| 'timer'
| 'toolbar',
>),
accessibilityRole: PropTypes.oneOf(DeprecatedAccessibilityRoles),

@@ -117,7 +84,3 @@ accessibilityState: PropTypes.object,

*/
accessibilityLiveRegion: (PropTypes.oneOf([
'none',
'polite',
'assertive',
]): React$PropType$Primitive<'none' | 'polite' | 'assertive'>),
accessibilityLiveRegion: PropTypes.oneOf(['none', 'polite', 'assertive']),

@@ -133,3 +96,3 @@ /**

*/
importantForAccessibility: (PropTypes.oneOf([
importantForAccessibility: PropTypes.oneOf([
'auto',

@@ -139,3 +102,3 @@ 'yes',

'no-hide-descendants',
]): React$PropType$Primitive<'auto' | 'yes' | 'no' | 'no-hide-descendants'>),
]),

@@ -351,8 +314,3 @@ /**

*/
pointerEvents: (PropTypes.oneOf([
'box-none',
'none',
'box-only',
'auto',
]): React$PropType$Primitive<'box-none' | 'none' | 'box-only' | 'auto'>),
pointerEvents: PropTypes.oneOf(['box-none', 'none', 'box-only', 'auto']),

@@ -359,0 +317,0 @@ /**

@@ -8,3 +8,2 @@ /**

* @format
* @flow
*/

@@ -27,6 +26,3 @@

...DeprecatedTransformPropTypes,
backfaceVisibility: (ReactPropTypes.oneOf([
'visible',
'hidden',
]): React$PropType$Primitive<'visible' | 'hidden'>),
backfaceVisibility: ReactPropTypes.oneOf(['visible', 'hidden']),
backgroundColor: DeprecatedColorPropType,

@@ -49,7 +45,3 @@ borderColor: DeprecatedColorPropType,

borderBottomEndRadius: ReactPropTypes.number,
borderStyle: (ReactPropTypes.oneOf([
'solid',
'dotted',
'dashed',
]): React$PropType$Primitive<'solid' | 'dotted' | 'dashed'>),
borderStyle: ReactPropTypes.oneOf(['solid', 'dotted', 'dashed']),
borderWidth: ReactPropTypes.number,

@@ -56,0 +48,0 @@ borderTopWidth: ReactPropTypes.number,

{
"name": "deprecated-react-native-prop-types",
"version": "1.1.0",
"version": "2.0.0",
"description": "Deprecated prop-types from React Native.",

@@ -11,9 +11,14 @@ "license": "MIT",

"dependencies": {
"@react-native/normalize-color": "*",
"invariant": "*",
"prop-types": "*"
},
"peerDependencies": {
"react": "*",
"react-native": "*"
"prettier": {
"requirePragma": true,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": false,
"jsxBracketSameLine": true,
"arrowParens": "avoid"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc