Work on Android even if style is not passed in
Otherwise we get a "Cannot read property 'borderRadius' of undefined" since [flattenStyle() will return undefined](62e8ddc205/Libraries/StyleSheet/flattenStyle.js (L28)
) if style is undefined.
This commit is contained in:
parent
eed84a2dd5
commit
fcb8deac05
|
@ -16,7 +16,7 @@ var LinearGradient = React.createClass({
|
|||
|
||||
// inherit container borderRadius until this issue is resolved:
|
||||
// https://github.com/facebook/react-native/issues/3198
|
||||
var borderRadius = flattenStyle(style).borderRadius || 0;
|
||||
var borderRadius = style && flattenStyle(style).borderRadius || 0;
|
||||
|
||||
return (
|
||||
<View {...otherProps} style={style}>
|
||||
|
|
Loading…
Reference in New Issue