Skip to content

Commit

Permalink
Update README.md (#3395)
Browse files Browse the repository at this point in the history
* Update README.md

Updated documentation for a common issue, (Highly Suggest placing this at the to of the MapView Component Documentation, but I will follow community standards for now)

* Update README.md

Updated to be more descriptive.
  • Loading branch information
ralph-dev committed Apr 20, 2020
1 parent 0644440 commit 5f63484
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
Expand Up @@ -652,6 +652,29 @@ Good:
</View>
```

### Children Components Not Re-Rendering
Components that aren't declared by this library (Ex: Markers, Polyline) must not be children of the MapView component due to MapView's unique rendering methodology. Have your custom components / views outside the MapView component and position absolute to ensure they only re-render as needed.
Example:
Bad:

```jsx
<View style={StyleSheet.absoluteFillObject}>
<MapView style={StyleSheet.absoluteFillObject}>
<View style={{ position: 'absolute', top: 100, left: 50 }}/>
</MapView>
</View>
```

Good:

```jsx
<View style={StyleSheet.absoluteFillObject}>
<MapView style={StyleSheet.absoluteFillObject} />
<View style={{ position: 'absolute', top: 100, left: 50 }}/>
</View>
```

Source: https://github.com/react-native-community/react-native-maps/issues/1901

License
--------
Expand Down

0 comments on commit 5f63484

Please sign in to comment.