You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to implement my own hook for managing some map events, and I've found out that using
const{ map }=useContext(MapContext)
anywhere in my code forces the component to rerender during each map drag / zoom animation frame. As react provides no way to limit updates coming from context, is there any other way to improve performance of my code? I only need map or eventManager from context, no viewport (that is actually causing the changes).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to implement my own hook for managing some map events, and I've found out that using
anywhere in my code forces the component to rerender during each map drag / zoom animation frame. As react provides no way to limit updates coming from context, is there any other way to improve performance of my code? I only need
map
oreventManager
from context, no viewport (that is actually causing the changes).Beta Was this translation helpful? Give feedback.
All reactions