Skip to content

Commit db5d308

Browse files
gesipatricio
authored andcommitted
Update README: Use callback in ref attribute (react-native-maps#1345)
`this.refs`/string as ref is deprecated.
1 parent 96bd15a commit db5d308

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ getInitialState() {
405405
takeSnapshot () {
406406
// 'takeSnapshot' takes a config object with the
407407
// following options
408-
const snapshot = this.refs.map.takeSnapshot({
408+
const snapshot = this.map.takeSnapshot({
409409
width: 300, // optional, when omitted the view-width is used
410410
height: 300, // optional, when omitted the view-height is used
411411
region: {..}, // iOS only, optional region to render
@@ -421,7 +421,7 @@ takeSnapshot () {
421421
render() {
422422
return (
423423
<View>
424-
<MapView initialRegion={...} ref="map">
424+
<MapView initialRegion={...} ref={map => { this.map = map }}>
425425
<MapView.Marker coordinate={this.state.coordinate} />
426426
</MapView>
427427
<Image source={{ uri: this.state.mapSnapshot.uri }} />

0 commit comments

Comments
 (0)