Next.js Discord

Discord Forum

MarkerClustererF not working properly in Next.js with React strict mode enabled

Unanswered
Miniature Fox Terrier posted this in #help-forum
Open in Discord
Miniature Fox TerrierOP
I am having an issue with MarkerClustererF not working properly in Next.js with React strict mode enabled. I am using Next.js 13.5.4 and React 18.

In my previous version of Next.js (13.4.13), MarkerClustererF was working fine. However, after updating to Next.js 13.5.4, MarkerClustererF is not rendering properly.

The issue is that the markers are not clustering together. Instead, they are all rendered as individual markers.

I have tried the following solutions:

Disabling React strict mode in next.config.js
Using the useMemo hook to cache the MarkerClustererF instance
Both of these solutions resolve the issue, but I would prefer to keep React strict mode enabled.

I am wondering if anyone else is experiencing this issue? If so, have you found a solution that works without disabling React strict mode?

Thanks for your help!

0 Replies