use flattenStyle for style introspection
This commit is contained in:
parent
48728d6d19
commit
7694263f78
|
@ -1,5 +1,5 @@
|
||||||
var React = require('react-native');
|
var React = require('react-native');
|
||||||
var StyleSheetRegistry = require('StyleSheetRegistry');
|
var flattenStyle = require('flattenStyle');
|
||||||
var { requireNativeComponent, PropTypes, View, processColor } = React;
|
var { requireNativeComponent, PropTypes, View, processColor } = React;
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,15 +17,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;
|
var borderRadius = flattenStyle(style).borderRadius || 0;
|
||||||
if (typeof style === 'number') {
|
|
||||||
borderRadius = StyleSheetRegistry.getStyleByID(style).borderRadius;
|
|
||||||
} else {
|
|
||||||
borderRadius = style.borderRadius;
|
|
||||||
}
|
|
||||||
if (!borderRadius) {
|
|
||||||
borderRadius = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={style}>
|
<View style={style}>
|
||||||
|
|
Loading…
Reference in New Issue