Merge pull request #118 from aprct/master
Implement setNativeProps to allow use in TouchableHighlight, etc
This commit is contained in:
commit
8aab9d9f53
|
@ -10,6 +10,10 @@ export default class LinearGradient extends Component {
|
|||
...View.propTypes,
|
||||
};
|
||||
|
||||
setNativeProps(props) {
|
||||
this.c.setNativeProps(props);
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
children,
|
||||
|
@ -44,7 +48,7 @@ export default class LinearGradient extends Component {
|
|||
];
|
||||
|
||||
return (
|
||||
<View {...otherProps} style={style}>
|
||||
<View ref={(c) => { this.c = c; }} {...otherProps} style={style}>
|
||||
<NativeLinearGradient
|
||||
style={{position: 'absolute', top: 0, left: 0, bottom: 0, right: 0}}
|
||||
colors={colors.map(processColor)}
|
||||
|
|
|
@ -14,6 +14,10 @@ export default class LinearGradient extends Component {
|
|||
...View.propTypes,
|
||||
};
|
||||
|
||||
setNativeProps(props) {
|
||||
this.c.setNativeProps(props);
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
colors,
|
||||
|
@ -26,6 +30,7 @@ export default class LinearGradient extends Component {
|
|||
|
||||
return (
|
||||
<NativeLinearGradient
|
||||
ref={(c) => { this.c = c; }}
|
||||
{...otherProps}
|
||||
colors={colors.map(processColor)}
|
||||
locations={locations ? locations.slice(0, colors.length) : null}
|
||||
|
|
Loading…
Reference in New Issue