<?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 Question on using the Recenter demo widget w/in TypeScript in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/question-on-using-the-recenter-demo-widget-w-in/m-p/590784#M55197</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was following along with the custom Recenter widget &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/widgets-custom-recenter/index.html#1c" rel="nofollow noopener noreferrer" target="_blank"&gt;example&lt;/A&gt;&amp;nbsp;in the JSAPI docs and found that I had to make a few changes to get it to work.&amp;nbsp; Being very much a newcomer to TypeScript, I was hoping someone could explain what I'm missing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a main.ts file into which I'm importing the custom widget:&lt;/P&gt;&lt;DIV&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import { Recenter } from "app/Recenter";&lt;/PRE&gt;Then in the Recenter.tsx, I had to change the export and add a dummy&amp;nbsp;parameter to the constructor:&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;@subclass("esri.widgets.Recenter")
export class Recenter extends declared(Widget) {
  constructor(args:any) {
  super();
  this._onViewChange = this._onViewChange.bind(this)
}&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above changes work, I'm just not clear why the sample required modification.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--john&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 16:40:03 GMT</pubDate>
    <dc:creator>JohnCartwright3</dc:creator>
    <dc:date>2021-12-12T16:40:03Z</dc:date>
    <item>
      <title>Question on using the Recenter demo widget w/in TypeScript</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/question-on-using-the-recenter-demo-widget-w-in/m-p/590784#M55197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was following along with the custom Recenter widget &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/widgets-custom-recenter/index.html#1c" rel="nofollow noopener noreferrer" target="_blank"&gt;example&lt;/A&gt;&amp;nbsp;in the JSAPI docs and found that I had to make a few changes to get it to work.&amp;nbsp; Being very much a newcomer to TypeScript, I was hoping someone could explain what I'm missing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a main.ts file into which I'm importing the custom widget:&lt;/P&gt;&lt;DIV&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import { Recenter } from "app/Recenter";&lt;/PRE&gt;Then in the Recenter.tsx, I had to change the export and add a dummy&amp;nbsp;parameter to the constructor:&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;@subclass("esri.widgets.Recenter")
export class Recenter extends declared(Widget) {
  constructor(args:any) {
  super();
  this._onViewChange = this._onViewChange.bind(this)
}&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above changes work, I'm just not clear why the sample required modification.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--john&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:40:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/question-on-using-the-recenter-demo-widget-w-in/m-p/590784#M55197</guid>
      <dc:creator>JohnCartwright3</dc:creator>
      <dc:date>2021-12-12T16:40:03Z</dc:date>
    </item>
  </channel>
</rss>

