<?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: Lifecycle issue with @arcgis/map-components-react in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/lifecycle-issue-with-arcgis-map-components-react/m-p/1538924#M85683</link>
    <description>&lt;P&gt;If you had a github repro, would be easier to tell. One thing you can do is add the "autoDestroyDisabled" to your components. All the map components have it.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/references/map-components/?path=/docs/component-reference-map--docs" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/references/map-components/?path=/docs/component-reference-map--docs&lt;/A&gt;&lt;/P&gt;&lt;P&gt;From the description:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;SPAN&gt;If true, the component will not be destroyed automatically when it is disconnected from the document. This is useful when you want to move the component to a different place on the page, or temporary hide it. If this is set, make sure to call the `destroy` method when you are done to prevent memory leaks.&lt;/SPAN&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 16 Sep 2024 14:23:27 GMT</pubDate>
    <dc:creator>ReneRubalcava</dc:creator>
    <dc:date>2024-09-16T14:23:27Z</dc:date>
    <item>
      <title>Lifecycle issue with @arcgis/map-components-react</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/lifecycle-issue-with-arcgis-map-components-react/m-p/1538808#M85682</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Got a lifecycle issue in my react application I can't seem to figure out. Hopefully someone can point me in the right direction.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Situation: I've got a React SPA which has a map on several components this is working fine on the initial rendering and while interacting on the given component. The issue occurs when navigating away from the component I'll get the following errors in the console:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jvpelt_0-1726480593374.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/115145iF1F728F9FE48A40C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jvpelt_0-1726480593374.png" alt="jvpelt_0-1726480593374.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After these errors have been thrown the map does not behave as intended for example the expand widget no longer loads:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Initial load:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jvpelt_1-1726480658485.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/115146i6756D4FFF389EE4C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jvpelt_1-1726480658485.png" alt="jvpelt_1-1726480658485.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Loading a map after the errors:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jvpelt_2-1726480696758.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/115147i0EC61C589236EB25/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jvpelt_2-1726480696758.png" alt="jvpelt_2-1726480696758.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't seem to find anything in the documentation about the need to manually clean up any references or something so any help regarding this issue will be highly appreciated&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"@arcgis/core"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"^4.30.9"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"@arcgis/map-components-react"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"^4.30.7"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 11:03:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/lifecycle-issue-with-arcgis-map-components-react/m-p/1538808#M85682</guid>
      <dc:creator>jvpelt</dc:creator>
      <dc:date>2024-09-16T11:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: Lifecycle issue with @arcgis/map-components-react</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/lifecycle-issue-with-arcgis-map-components-react/m-p/1538924#M85683</link>
      <description>&lt;P&gt;If you had a github repro, would be easier to tell. One thing you can do is add the "autoDestroyDisabled" to your components. All the map components have it.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/references/map-components/?path=/docs/component-reference-map--docs" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/references/map-components/?path=/docs/component-reference-map--docs&lt;/A&gt;&lt;/P&gt;&lt;P&gt;From the description:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;SPAN&gt;If true, the component will not be destroyed automatically when it is disconnected from the document. This is useful when you want to move the component to a different place on the page, or temporary hide it. If this is set, make sure to call the `destroy` method when you are done to prevent memory leaks.&lt;/SPAN&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 14:23:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/lifecycle-issue-with-arcgis-map-components-react/m-p/1538924#M85683</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2024-09-16T14:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: Lifecycle issue with @arcgis/map-components-react</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/lifecycle-issue-with-arcgis-map-components-react/m-p/1538946#M85684</link>
      <description>&lt;P&gt;Thanks! This solved the issue!&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 15:01:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/lifecycle-issue-with-arcgis-map-components-react/m-p/1538946#M85684</guid>
      <dc:creator>jvpelt</dc:creator>
      <dc:date>2024-09-16T15:01:09Z</dc:date>
    </item>
    <item>
      <title>Re: Lifecycle issue with @arcgis/map-components-react</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/lifecycle-issue-with-arcgis-map-components-react/m-p/1578323#M86425</link>
      <description>&lt;P&gt;I had a similar issue using Angular. I'm just commenting here with the text of the related warnings to help other people find this.&lt;BR /&gt;&lt;BR /&gt;[esri.widgets.Expand] TypeError: Cannot read properties of null (reading 'getPosition')&lt;BR /&gt;&lt;BR /&gt;"component has already been destroyed. It cannot be used again. If you meant to disconnect and reconnect a component without automatic destroy, set the autoDestroyDisabled prop."&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2025 18:12:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/lifecycle-issue-with-arcgis-map-components-react/m-p/1578323#M86425</guid>
      <dc:creator>DanRussell</dc:creator>
      <dc:date>2025-01-23T18:12:53Z</dc:date>
    </item>
  </channel>
</rss>

