react-leaflet icon indicating copy to clipboard operation
react-leaflet copied to clipboard

Incompatibility with lazy loading

Open yurihnrq opened this issue 1 year ago • 0 comments

Bug report in v4

  • [x] All peer dependencies are installed: React, ReactDOM and Leaflet.
  • [x] Using the latest version of React and ReactDOM v18.
  • [x] Using the supported version of Leaflet (v1.8.0 minimum) and its corresponding CSS file is loaded.
  • [x] Using the latest v4 version of React-Leaflet.
  • [x] The issue has not already been reported.
  • [x] Make sure you have followed the quick start guide for Leaflet.
  • [x] Make sure you have fully read the documentation and that you understand the limitations.

Expected behavior

Stay at suspense fallback until all components are lazy loaded, then render them.

Actual behavior

An error is thrown:

image

Steps to reproduce

Go to this StackBlitz and navigate to a route that contains a lazy loaded component (Circle and Both);

yurihnrq avatar Mar 08 '23 22:03 yurihnrq