Infobox duplicated in array.map #3078
-
I am having a weird issue where I am mapping through and array of locations and displaying a map with markers and for each marker there is a child info-box. The issue I am seeing is that for each marker, there are two info-boxes, one is correct and has the title etc and the other is an empty info-box with just a close x and a down error. Please see below.
see screenshot below: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
If anyone comes across this issue: the solution is here tldr: StrictMode was detecting unexpected side effects on my map component, which was intentionally double-invoking my useState function, making two InfoWindows appear, instead of just one. Remove strict mode and the issue should go away. |
Beta Was this translation helpful? Give feedback.
If anyone comes across this issue: the solution is here
tldr: StrictMode was detecting unexpected side effects on my map component, which was intentionally double-invoking my useState function, making two InfoWindows appear, instead of just one.
Remove strict mode and the issue should go away.