Answer the question
In order to leave comments, you need to log in
How to hang a click handler in react-yandex-maps?
why is this code not working:
export default function({center, clickOnMap}) {
return (
<YMaps query={{
apikey: 'my_api_key',
}}>
<div>
<Map
className='map-container'
state={{center: center, zoom: 16}}
onLoad={(inst)=>{return inst.events.add('click', clickOnMap)}}
>
<Placemark geometry={center} />
</Map>
</div>
</YMaps>
)
}
Answer the question
In order to leave comments, you need to log in
why is this code not working
onLoad={(inst)=>{return inst.events.add('click', clickOnMap)}}
instanceRef={inst => inst.events.add('click', clickOnMap)}
onClick={clickOnMap}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question