Small refactor

Reviewed By: cpojer

Differential Revision: D7498659

fbshipit-source-id: 43ad85645e2366a385e08d68172e76e336fdfb1f
This commit is contained in:
Peter van der Zee 2018-04-05 06:14:54 -07:00 committed by Facebook Github Bot
parent cea798c57b
commit 439614891c
1 changed files with 2 additions and 3 deletions

View File

@ -746,10 +746,9 @@ const ScrollView = createReactClass({
this.props.horizontal && styles.contentContainerHorizontal,
this.props.contentContainerStyle,
];
let style, childLayoutProps;
if (__DEV__ && this.props.style) {
style = flattenStyle(this.props.style);
childLayoutProps = ['alignItems', 'justifyContent']
const style = flattenStyle(this.props.style);
const childLayoutProps = ['alignItems', 'justifyContent']
.filter((prop) => style && style[prop] !== undefined);
invariant(
childLayoutProps.length === 0,