color conversion in JS
This commit is contained in:
parent
210ea4ce90
commit
1a2cd1c4f2
|
@ -5,7 +5,17 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
var { requireNativeComponent, } = require('react-native');
|
||||
var LinearGradient = requireNativeComponent('BVLinearGradient', null);
|
||||
var React = require('react-native');
|
||||
var { requireNativeComponent, processColor } = React;
|
||||
var NativeLinearGradient = requireNativeComponent('BVLinearGradient', null);
|
||||
|
||||
var LinearGradient = React.createClass({
|
||||
render: function() {
|
||||
var { colors, ...otherProps } = this.props;
|
||||
return (
|
||||
<NativeLinearGradient {...otherProps} colors={colors.map(processColor)} />
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = LinearGradient;
|
||||
|
|
Loading…
Reference in New Issue