react-map-interaction
react-map-interaction copied to clipboard
Creating a minimap controlled from Main Map
Hi I have created a minimap which follows the main maps translation and zoom. However I have noticed that once I start using state to control map movement and zoom after some time the performance of the app drops significantly. Eg much slower panning and zoom responsiveness. I was wondering if you could shed any light on the issue/what I am doing wrong.
Much appreciated!
Project Github: https://github.com/MrTesau/travel-azeroth-client
Pretty late, but here you go: When using it in controlled mode, move your children to a component and use React.memo (or PureComponent). That way your setState will not cause the map contents to re-render.