Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a minimap controlled from Main Map #80

Open
MrTesau opened this issue Dec 19, 2020 · 1 comment
Open

Creating a minimap controlled from Main Map #80

MrTesau opened this issue Dec 19, 2020 · 1 comment

Comments

@MrTesau
Copy link

MrTesau commented Dec 19, 2020

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

@jiafra
Copy link

jiafra commented Mar 19, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants