Skip to content

Commit

Permalink
Add clarification on initialRegion behaviour (react-native-maps#628)
Browse files Browse the repository at this point in the history
* Add clarification on initialRegion behaviour

Use case: specifying an `initialRegion` when `fitToSuppliedMarkers` is used in `ComponentDidMount`

* Add recommendation on using `fitToSuppliedMarkers`

Using `fitToSuppliedMarkers` in `ComponentDidMount` blocks the UI in Android before the map renders, nothing perceived in IOS simulator.  This is to be expected since 
> Sometimes components will do additional work on componentDidMount, which might result in a second stutter in the transition. 
 As stated in [rn docs](https://facebook.github.io/react-native/docs/performance.html#javascript-frame-rate)
  • Loading branch information
haikyuu authored and christopherdro committed Oct 5, 2016
1 parent 31b3c57 commit f226d90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/mapview.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
| `animateToRegion` | `region: Region`, `duration: Number` |
| `animateToCoordinate` | `region: Coordinate`, `duration: Number` |
| `fitToElements` | `animated: Boolean` |
| `fitToSuppliedMarkers` | `markerIDs: String[]` |
| `fitToSuppliedMarkers` | `markerIDs: String[]` | If you need to use this in `ComponentDidMount`, make sure you put it in a timeout or it will cause performance problems.
| `fitToCoordinates` | `coordinates: Array<LatLng>, edgePadding: EdgePadding, animated: Boolean` |


Expand Down

0 comments on commit f226d90

Please sign in to comment.