I have a higher order component that I try to modify a bit (I'm not familiar with recompose).
So thats my component:
<Map mycenter={mycenter} />
I want the map-component to update or to rerendered if the mycenter is updated. I'm trying to modify the code from https://github.com/istarkov/google-map-thousands-markers/blob/master/src/Map.js
I made some modifications to the code. First, the map center is set to mycenter. That works.
withState('mapParams', 'setMapParams', ({ mycenter }) => ({ center:mycenter, zoom: 12 })),
After that the user can click somewhere and the center will be modified
withHandlers({
onMapParamsChange: ({ setMapParams }) => ({ center, zoom, bounds }) => {
setMapParams({ center, zoom, bounds });
console.log('setMapParams', { center, zoom });
},
Is there a way so that the component rerenders or the center is updated if "mycenter" is updated?