Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FlowCleanup] Rename and move ViewStylePropTypes #21415

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Libraries/Animated/src/createAnimatedComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
const {AnimatedEvent} = require('./AnimatedEvent');
const AnimatedProps = require('./nodes/AnimatedProps');
const React = require('React');
const ViewStylePropTypes = require('ViewStylePropTypes');
const DeprecatedViewStylePropTypes = require('DeprecatedViewStylePropTypes');

const invariant = require('fbjs/lib/invariant');

Expand Down Expand Up @@ -184,7 +184,7 @@ function createAnimatedComponent(Component: any): any {
return;
}

for (const key in ViewStylePropTypes) {
for (const key in DeprecatedViewStylePropTypes) {
if (!propTypes[key] && props[key] !== undefined) {
console.warn(
'You are setting the style `{ ' +
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Components/Slider/Slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ type Props = $ReadOnly<{|

/**
* Used to style and layout the `Slider`. See `StyleSheet.js` and
* `ViewStylePropTypes.js` for more info.
* `DeprecatedViewStylePropTypes.js` for more info.
*/
style?: ?ViewStyleProp,

Expand Down
4 changes: 2 additions & 2 deletions Libraries/Components/View/ReactNativeStyleAttributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

const DeprecatedImageStylePropTypes = require('DeprecatedImageStylePropTypes');
const TextStylePropTypes = require('TextStylePropTypes');
const ViewStylePropTypes = require('ViewStylePropTypes');
const DeprecatedViewStylePropTypes = require('DeprecatedViewStylePropTypes');

const processColor = require('processColor');
const processTransform = require('processTransform');
Expand All @@ -21,7 +21,7 @@ const sizesDiffer = require('sizesDiffer');
const ReactNativeStyleAttributes = {};

for (const attributeName of Object.keys({
...ViewStylePropTypes,
...DeprecatedViewStylePropTypes,
...TextStylePropTypes,
...DeprecatedImageStylePropTypes,
})) {
Expand Down
6 changes: 4 additions & 2 deletions Libraries/DeprecatedPropTypes/DeprecatedViewPropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const DeprecatedEdgeInsetsPropType = require('DeprecatedEdgeInsetsPropType');
const PlatformViewPropTypes = require('PlatformViewPropTypes');
const PropTypes = require('prop-types');
const DeprecatedStyleSheetPropType = require('DeprecatedStyleSheetPropType');
const ViewStylePropTypes = require('ViewStylePropTypes');
const DeprecatedViewStylePropTypes = require('DeprecatedViewStylePropTypes');

const {
AccessibilityComponentTypes,
Expand All @@ -23,7 +23,9 @@ const {
AccessibilityStates,
} = require('ViewAccessibility');

const stylePropType = DeprecatedStyleSheetPropType(ViewStylePropTypes);
const stylePropType = DeprecatedStyleSheetPropType(
DeprecatedViewStylePropTypes,
);

module.exports = {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const DeprecatedTransformPropTypes = require('DeprecatedTransformPropTypes');
/**
* Warning: Some of these properties may not be supported in all releases.
*/
const ViewStylePropTypes = {
const DeprecatedViewStylePropTypes = {
...LayoutPropTypes,
...DeprecatedShadowPropTypesIOS,
...DeprecatedTransformPropTypes,
Expand Down Expand Up @@ -58,4 +58,4 @@ const ViewStylePropTypes = {
elevation: ReactPropTypes.number,
};

module.exports = ViewStylePropTypes;
module.exports = DeprecatedViewStylePropTypes;
4 changes: 2 additions & 2 deletions Libraries/StyleSheet/StyleSheetValidation.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

const DeprecatedImageStylePropTypes = require('DeprecatedImageStylePropTypes');
const TextStylePropTypes = require('TextStylePropTypes');
const ViewStylePropTypes = require('ViewStylePropTypes');
const DeprecatedViewStylePropTypes = require('DeprecatedViewStylePropTypes');

const invariant = require('fbjs/lib/invariant');

Expand Down Expand Up @@ -87,7 +87,7 @@ const allStylePropTypes = {};
if (__DEV__ && !global.__RCTProfileIsProfiling) {
StyleSheetValidation.addValidStylePropTypes(DeprecatedImageStylePropTypes);
StyleSheetValidation.addValidStylePropTypes(TextStylePropTypes);
StyleSheetValidation.addValidStylePropTypes(ViewStylePropTypes);
StyleSheetValidation.addValidStylePropTypes(DeprecatedViewStylePropTypes);
}

module.exports = StyleSheetValidation;
4 changes: 2 additions & 2 deletions Libraries/Text/TextStylePropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

const DeprecatedColorPropType = require('DeprecatedColorPropType');
const ReactPropTypes = require('prop-types');
const ViewStylePropTypes = require('ViewStylePropTypes');
const DeprecatedViewStylePropTypes = require('DeprecatedViewStylePropTypes');

const TextStylePropTypes = {
...ViewStylePropTypes,
...DeprecatedViewStylePropTypes,

color: DeprecatedColorPropType,
fontFamily: ReactPropTypes.string,
Expand Down