Warning: Failed prop type: Invalid prop `destination` supplied to `MapViewDirections`
See original GitHub issue<MapView
region={{
latitude: this.state.location.latitude,
longitude: this.state.location.longitude,
latitudeDelta: LATITUDE_DELTA,
longitudeDelta: LONGITUDE_DELTA,
}}
onRegionChange={this.onRegionChange}
initialRegion={{
latitude: this.state.location.latitude,
longitude: this.state.location.longitude,
latitudeDelta: LATITUDE_DELTA,
longitudeDelta: LONGITUDE_DELTA,
}}
onMapReady={Platform.OS === 'android' ? this.onMapLayout : null}
onLayout={Platform.OS === 'ios' ? this.onMapLayout : null}
mapType='standard'
showsCompass
showsBuildings>
{ this.state.isMapReady &&
<MapViewDirections
origin={this.state.location}
destination={this.state.destination}
apikey={this.state.maps_apikey}
strokeWidth={3}
strokeColor="blue"
/>
}
</MapView>
this returns:
Warning: Failed prop type: invalid prop destination
supplied to MapViewDirections
.
This is a bug? Any solution?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6
Top Results From Across the Web
Invalid prop `region.latitude` of type `string` supplied to ...
js file and assign it to longitude and latitude values. but I'm getting an error saying... Warning: Failed prop type: Invalid prop region....
Read more >react-native-maps-directions - npm
The mandatory MapViewDirections props are: origin : The coordinate of the origin location; destination : The coordinate of the destination ...
Read more >How to use MapViewDirections in react-native-maps-directions
const Directions = ({ destination, origin, onReady }) => (
Read more >Warning failed prop type the prop 'x' is marked as required ...
Coding example for the question Warning failed prop type the prop 'x' is marked as required when updating mapView-React Native.
Read more >react-native-maps-directions - npm package - Snyk
The mandatory MapViewDirections props are: ... Once the directions in between destination and origin has been fetched, ... Prop, Type, Default, Note ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found the problem! Just parse the
and
to float, it’s string! (Using parseFloat function)
cast value every change { latitude: parseFloat(latitude), longitude: parseFloat(longitude) }