This repository has been archived by the owner on Jul 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 79
Any alternatives to using loadModules.then? #87
Comments
Have a look on that package |
We're currently using the create-react-app and the @esri/react-arcgis packages. Can this @arcgis/webpack-plugin package be used in addition or is it an alternative package? |
It is alternative package, it will enable you from importing esri staff like the following. |
Thanks for the info. |
You may have trouble using @arcgis/webpack-plugin w/ create-react-app: Esri/arcgis-webpack-plugin#12 If so, you'll need to use esri-loader and/or react-arcgis, which means you will not be able to If your problem is that |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
We're using version 4.0.0 of the @esri/react-arcgis npm package.
I have a question about using this package within a react project.
Is there a way, outside of using the loadModules function, to load modules that we need?
For example, if we try to create a new Circle object outside of the 'loadModules.then' function, we get this error "'Circle' is not defined no-undef".
If we try to import the Circle object from the react-arcgis package:
import { Circle } from '@esri/react-arcgis'
We get this error: "Attempted import error: 'Circle' is not exported from '@esri/react-arcgis'.".
We also tried this:
import { Circle, Graphic } from 'esri-loader';
But then this code:
Causes this error:
TypeError: esri_loader__WEBPACK_IMPORTED_MODULE_9__.Circle is not a constructor
We totally understand we may have to use the loadModules function to load the modules we need, but we're wondering if there's another, perhaps simpler way.
Thanks.
The text was updated successfully, but these errors were encountered: