mirror of
https://github.com/status-im/react-native-fast-image.git
synced 2026-09-01 22:31:06 +00:00
chore: Update example to React Native 0.61.5. (#639)
This also upgrades all the dependencies.
This commit is contained in:
@@ -20,11 +20,15 @@ class AutoSizingImage extends Component {
|
||||
nativeEvent: { width, height },
|
||||
} = e
|
||||
this.setState({ width, height })
|
||||
if (this.props.onLoad) this.props.onLoad(e)
|
||||
if (this.props.onLoad) {
|
||||
this.props.onLoad(e)
|
||||
}
|
||||
}
|
||||
|
||||
getHeight = () => {
|
||||
if (!this.state.height) return this.props.defaultHeight
|
||||
if (!this.state.height) {
|
||||
return this.props.defaultHeight
|
||||
}
|
||||
const ratio = this.state.height / this.state.width
|
||||
const height = this.props.width * ratio
|
||||
return height
|
||||
|
||||
Reference in New Issue
Block a user