use flattenStyle for style introspection

This commit is contained in:
Dmitry Gladkov 2016-01-27 15:16:29 +02:00
parent 48728d6d19
commit 7694263f78
1 changed files with 2 additions and 10 deletions

View File

@ -1,5 +1,5 @@
var React = require('react-native');
var StyleSheetRegistry = require('StyleSheetRegistry');
var flattenStyle = require('flattenStyle');
var { requireNativeComponent, PropTypes, View, processColor } = React;
@ -17,15 +17,7 @@ var LinearGradient = React.createClass({
// inherit container borderRadius until this issue is resolved:
// https://github.com/facebook/react-native/issues/3198
var borderRadius;
if (typeof style === 'number') {
borderRadius = StyleSheetRegistry.getStyleByID(style).borderRadius;
} else {
borderRadius = style.borderRadius;
}
if (!borderRadius) {
borderRadius = 0;
}
var borderRadius = flattenStyle(style).borderRadius || 0;
return (
<View style={style}>