Select to view content in your preferred language

Custom widgets in 4.18

339
0
02-02-2021 01:21 PM
by Anonymous User
Not applicable

I'm trying to implement a custom widget using example code from ESRI's jsapi-resources GitHub repo TypeScript application as the basic structure, and ESRI's sample code from the ArcGIS for Javascript API documentation for a custom widget.

When I implement the custom Recenter widget in the basic typescript application it throws this error:

Anthony-MTFWP_0-1612300193245.png

Viewing the transpiled JavaScript file it is using the 'new' keyword to construct the widget instance. Interestingly, the 'View Live' link on the sample code page is also not working:

Anthony-MTFWP_1-1612300278907.png

Is there something that changed in 4.18 related to widgets that hasn't been accounted for in the sample code examples yet?

I have a working application on 4.13 that uses a custom widget based on the Share widget in ESRI's configurable-app-components repo. I get a similar dojoLoader error when trying to use that widget in the 4.18 sample application, even when modified to follow the patterns in the current version of the repo, as far as I can tell. Is there a recommended way to build and import a .tsx widget that works with the 4.18 sample application?

0 Kudos
0 Replies