Select to view content in your preferred language

How to compile a widget integrated with React

622
0
02-28-2018 08:28 PM
AyakoSUZUKI
Regular Contributor

I created React component which shows data retrieved from DB via API (The API is not ArcGIS API for JavaScript, just for searching data) and it works fine.

Then I want to replace the component as a widget on the map.

I created the widget by extending widget class by following references about widget development.

Then I added the component to the widget and compiled the widget.

However it throw an error when I add the widget to the map.

It seems that the app references React module under dojo (https://js.arcgis.com/4.6/dojo/react/).

So I think I need to set some options when I compile the widget.

I am new to React, TypeScript and widget development.

So I probably miss something very basic, but it would be great if I get infromation about how to use React component in widget.

P.S.

I have already checked the React sample Esri and odoe provided, but it does not follow widget development workflow and it uses compiler library. So unfortunately it does not help.

0 Replies