react-native-linear-gradient/index.ios.js

26 lines
541 B
JavaScript
Raw Permalink Normal View History

/**
* @providesModule LinearGradient
* @flow
*/
'use strict';
2015-09-29 16:43:22 +00:00
var React = require('react-native');
var { requireNativeComponent, processColor, View } = React;
2015-09-29 16:43:22 +00:00
var NativeLinearGradient = requireNativeComponent('BVLinearGradient', null);
var LinearGradient = React.createClass({
propTypes: {
...View.propTypes,
},
2015-09-29 16:43:22 +00:00
render: function() {
var { colors, ...otherProps } = this.props;
return (
<NativeLinearGradient {...otherProps} colors={colors.map(processColor)} />
);
}
});
2015-03-31 17:44:16 +00:00
module.exports = LinearGradient;