I am trying to create a label in a map component using react-yandex-maps.
Until I add coordinates for the placemark, the application works correctly, the map is displayed. However, as soon as I add the coordinates for the label, I get the error: TypeError: Cannot read property ‘deserialize’ of undefined.
The following is the component code:
import React from 'react';
import './map-block.css';
import {YMaps, Map, Placemark} from 'react-yandex-maps';
const MapBlock = () = & gt; {
const mapState = {center: [59.939151, 30.329355], zoom: 16};
return (
& lt; section id = "map" className = "map container" & gt;
& lt; YMaps & gt;
& lt; Map state = {mapState} className = "map container" & gt;
& lt; Placemark geometry = {{coordinates: [59.940000, 30.32215]}} / & gt;
& lt; / Map & gt;
& lt; / YMaps & gt;
& lt; / section & gt;
)
};
export default MapBlock;
Can someone explain what could be the reason? Thanks in advance
Answer 1, authority 100%
You don’t need to specify “coordinates”, it works if you just specify geometry = {[59.940000, 30.32215]}. Apparently the examples I looked at earlier were not correct.