mirror of
https://github.com/status-im/react-native-linear-gradient.git
synced 2025-01-20 20:49:39 +00:00
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:
|
// inherit container borderRadius until this issue is resolved:
|
||||||
// https://github.com/facebook/react-native/issues/3198
|
// https://github.com/facebook/react-native/issues/3198
|
||||||
var borderRadius = flattenStyle(style).borderRadius || 0;
|
var borderRadius = style && flattenStyle(style).borderRadius || 0;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View {...otherProps} style={style}>
|
<View {...otherProps} style={style}>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user