From 0b2813b1866b739471c98573d3bb2139d565202b Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Thu, 3 Nov 2016 08:52:25 -0700 Subject: [PATCH] [fix] View when 'style' is not defined --- src/components/View/index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/View/index.js b/src/components/View/index.js index 055755cb..521e0594 100644 --- a/src/components/View/index.js +++ b/src/components/View/index.js @@ -66,8 +66,7 @@ class View extends Component { }; static defaultProps = { - accessible: true, - style: {} + accessible: true }; static childContextTypes = { @@ -97,7 +96,7 @@ class View extends Component { const flattenedStyle = StyleSheet.flatten(style); const pointerEventsStyle = pointerEvents && { pointerEvents }; // 'View' needs to set 'flexShrink:0' only when there is no 'flex' or 'flexShrink' style provided - const needsFlexReset = flattenedStyle.flex == null && flattenedStyle.flexShrink == null; + const needsFlexReset = !flattenedStyle || (flattenedStyle.flex == null && flattenedStyle.flexShrink == null); const normalizedEventHandlers = eventHandlerNames.reduce((handlerProps, handlerName) => { const handler = this.props[handlerName];