react-leaflet
react-leaflet copied to clipboard
Incompatibility with lazy loading
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:
Steps to reproduce
Go to this StackBlitz and navigate to a route that contains a lazy loaded component (Circle and Both);