I have created a custom <GoogleMap />
component (wrapper for react-google-map) which returns the latitude, longitude and zoomlevel on onClick event of the GoogleMap component. Now I want to wrap it up with the ant.design
Form.Item
component with the form.getFieldDecorator
but can't find a way to do it?
All I could do is
<Form.Item label="Point a location">
{
form.getFieldDecorator('map', {
valuePropName: 'onClick',
getValueFromEvent: mapData => {
console.log('mapData', mapData);
return mapData;
}
})(
<div>
<GoogleMap onClick={data => { console.log('Passed data to parent', data); }} />
</div>
)}
</Form.Item>
The on click event does log into the console but doesn't set the value or call the getValueFromEvent function. Any help is appreciated.