alex1kirch / react-leaflet-portal

The component allows to use the leaflet control panel like a normal React child. Features like context are availble because the component child still exists in the React tree.
https://react-leaflet-portal.herokuapp.com/#portal
MIT License
4 stars 0 forks source link

Unhandled Rejection (TypeError): RL.withLeaflet is not a function #1

Closed lalittolani closed 3 years ago

lalittolani commented 3 years ago

Using React Leaflet Portal with React-Leaflet 3.2.0 raises error ./node_modules/react-leaflet-portal/build/lib/components/Portal/Portal.js E:/src/components/Portal/Portal.tsx:81 __webpack_require__ E:/DMRC/super_scada_ui/webpack/bootstrap:789 786 | }; 787 | 788 | // Execute the module function

789 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId)); | ^ 790 | 791 | // Flag the module as loaded 792 | module.l = true;

alex1kirch commented 3 years ago

Hello, @lalittolani!

Thank you for your message. I think that React-Leaflet 3.2.0 had already solved the issue which solved by creating this package. The React-Leaflet 3.2.0 package use Context, and you can get access to the map object through the useMap hook.

So instead of the current React Leaflet Portal package, I recommend using https://react-leaflet.js.org/docs/example-react-control to solving your tasks.