Skip to content

Commit

Permalink
Allowing passing through of onLayout prop rather than overwriting and…
Browse files Browse the repository at this point in the history
… ignoring with measure function
  • Loading branch information
bilewinters authored and Minishlink committed Jun 2, 2021
1 parent 813eeaa commit 3839f29
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ export default class LinearGradient extends PureComponent {
height: 1,
};

measure = ({ nativeEvent }) =>
measure = (event) => {
this.setState({
width: nativeEvent.layout.width,
height: nativeEvent.layout.height,
width: event.nativeEvent.layout.width,
height: event.nativeEvent.layout.height,
});
if (this.props.onLayout) {
this.props.onLayout(event);
}
}

getAngle = () => {
if (this.props.useAngle) {
Expand Down

0 comments on commit 3839f29

Please sign in to comment.