<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Compatibility between JSAPI and new React runtime in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/compatibility-between-jsapi-and-new-react-runtime/m-p/1179640#M77576</link>
    <description>&lt;P&gt;There is still a React JSX runtime. The ArcGIS JSAPI widgets have a different jsx runtime that is not compatible with React., The TS compiler doesn't know to not try and compile a custom ArcGIS widget JSX like React and will fail. So, in short, yeah, if you want to mix a custom ArcGIS JSAPI widget with React, those comments are needed. I however would not recommend doing this, just build your components with whatever framework you are using or build web components if you are looking to share them across projects.&lt;/P&gt;</description>
    <pubDate>Thu, 02 Jun 2022 21:50:01 GMT</pubDate>
    <dc:creator>ReneRubalcava</dc:creator>
    <dc:date>2022-06-02T21:50:01Z</dc:date>
    <item>
      <title>Compatibility between JSAPI and new React runtime</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/compatibility-between-jsapi-and-new-react-runtime/m-p/1179638#M77575</link>
      <description>&lt;P&gt;I used Vite to create a React app with TypeScript. The app has a custom widget.&lt;/P&gt;&lt;P&gt;I have it all working, but I'm wondering if &lt;A href="https://github.com/odoe/cra-jsapi-ts-with-widgets#create-react-app-typescript-with-arcgis-jsapi-custom-widgets" target="_self"&gt;this information&lt;/A&gt;&amp;nbsp;by&amp;nbsp;@Anonymous User&amp;nbsp;is still valid:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;. . . React uses&amp;nbsp;&lt;STRONG&gt;React.createElement&lt;/STRONG&gt;&amp;nbsp;for vdom and the JSAPI uses&amp;nbsp;&lt;STRONG&gt;tsx&amp;nbsp;&lt;/STRONG&gt;and TypeScript only allows a single&amp;nbsp;&lt;STRONG&gt;jsxFactory&amp;nbsp;&lt;/STRONG&gt;to be defined.&lt;/P&gt;&lt;P&gt;. . .&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;// &lt;SPAN class=""&gt;@ts&lt;/SPAN&gt;-nocheck&lt;/SPAN&gt;
&lt;SPAN class=""&gt;/** &lt;SPAN class=""&gt;@jsxRuntime&lt;/SPAN&gt; classic */&lt;/SPAN&gt;
&lt;SPAN class=""&gt;/** &lt;SPAN class=""&gt;@jsx&lt;/SPAN&gt; tsx */&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;. . .&lt;/SPAN&gt;&lt;SPAN&gt;You lose type checking on your custom widget&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;However, React has a new runtime (called "automatic") that doesn't use &lt;STRONG&gt;React.createElement&lt;/STRONG&gt;. Details are&amp;nbsp;&lt;A href="https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html" target="_self"&gt;here&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;So the question is: &lt;EM&gt;Is the new React "automatic" runtime compatible with the ArcGIS JSAPI, such that we can (1) use the new runtime's features and (2) keep TS type checking, when making apps with custom widgets?&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 21:31:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/compatibility-between-jsapi-and-new-react-runtime/m-p/1179638#M77575</guid>
      <dc:creator>AndrewGilbert</dc:creator>
      <dc:date>2022-06-02T21:31:37Z</dc:date>
    </item>
    <item>
      <title>Re: Compatibility between JSAPI and new React runtime</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/compatibility-between-jsapi-and-new-react-runtime/m-p/1179640#M77576</link>
      <description>&lt;P&gt;There is still a React JSX runtime. The ArcGIS JSAPI widgets have a different jsx runtime that is not compatible with React., The TS compiler doesn't know to not try and compile a custom ArcGIS widget JSX like React and will fail. So, in short, yeah, if you want to mix a custom ArcGIS JSAPI widget with React, those comments are needed. I however would not recommend doing this, just build your components with whatever framework you are using or build web components if you are looking to share them across projects.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 21:50:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/compatibility-between-jsapi-and-new-react-runtime/m-p/1179640#M77576</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2022-06-02T21:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: Compatibility between JSAPI and new React runtime</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/compatibility-between-jsapi-and-new-react-runtime/m-p/1179650#M77577</link>
      <description>&lt;P&gt;OK, thanks. When we say "web components," I thought that a custom ArcGIS widget &lt;EM&gt;is&lt;/EM&gt; a web component. What's the difference exactly?&lt;/P&gt;&lt;P&gt;Specifically I'm looking to build a reusable widget/component that can be imported into any app and lets the user do dynamic queries, similar to definition queries in ArcGIS Pro where you can add as many criteria as you like. I was thinking React in order to dynamically add the query boxes, and the ArcGIS JSAPI for the ArcGIS integration (e.g. sending query to ArcGIS Server). I'm hoping to use TS and other "latest and greatest" things where it makes sense.&lt;/P&gt;&lt;P&gt;Any samples/insight/etc. appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 22:36:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/compatibility-between-jsapi-and-new-react-runtime/m-p/1179650#M77577</guid>
      <dc:creator>AndrewGilbert</dc:creator>
      <dc:date>2022-06-02T22:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: Compatibility between JSAPI and new React runtime</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/compatibility-between-jsapi-and-new-react-runtime/m-p/1179804#M77586</link>
      <description>&lt;P&gt;Sorry, when I say Web Components, I'm talking about &lt;A href="https://developer.mozilla.org/en-US/docs/Web/Web_Components" target="_self"&gt;native Web Components&lt;/A&gt;. Our JSAPI widgets are not native Web Components. We use and provide &lt;A href="https://developers.arcgis.com/calcite-design-system/" target="_self"&gt;Calcite Components&lt;/A&gt; that you can use too. There are a few options out there to more easily build Web Components, but &lt;A href="https://stenciljs.com/" target="_self"&gt;Stencil&lt;/A&gt; is very good.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 14:20:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/compatibility-between-jsapi-and-new-react-runtime/m-p/1179804#M77586</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2022-06-03T14:20:18Z</dc:date>
    </item>
  </channel>
</rss>

