Is there any better solution for this question?
I was also trying to call mapRef.current.resize()
when changing width of the sidebar, but only after width transition ends it can resize map to the correct size. So the blank part will be visible for time of the transition.