<?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 Redux store and the Settings Component in ArcGIS Experience Builder Questions</title>
    <link>https://community.esri.com/t5/arcgis-experience-builder-questions/redux-store-and-the-settings-component/m-p/1298934#M7220</link>
    <description>&lt;P&gt;I've been trying for the last couple days to implement a redux store for my widget/application and I've observed a few things.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can successfully dispatch to and read from my redux store from within the runtime component of my widget, however when I try to do the exact same thing from inside my Settings component, I'm receiving 'state.myState' is undefined.&lt;/P&gt;&lt;P&gt;Has anyone been able to update their redux store from the Settings component of a widget?&lt;/P&gt;&lt;P&gt;&amp;nbsp;I've simplified my implementation example but I think this illustrates what I'm trying to accomplish&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;export default class Setting extends React.PureComponent&amp;lt;
AllWidgetSettingProps&amp;lt;IMConfig&amp;gt; &amp;amp; {
  category: string
}, {}
&amp;gt; {
  static mapExtraStateProps (state: IMState) {
    return {
      category: state.layerState.category
    }
  }

  onChange = (evt) =&amp;gt; {
    this.props.dispatch({
      type: 'ADD_CATEGORY',
      val: evt.target.value
    })
  }

  render () {
    return (
        &amp;lt;div&amp;gt;
          &amp;lt;div className="widget-setting-layerListPlus"&amp;gt;
            &amp;lt;SettingSection
                title="Data Category"
                role="group"
                aria-label="Data Category"
            &amp;gt;
              &amp;lt;SettingRow&amp;gt;
                &amp;lt;div className="category-input w-100 d-flex flex-column" &amp;gt;
                  &amp;lt;div className="category-input-item input"&amp;gt;
                            &amp;lt;Input
                                id="category-input"
                                onChange={this.onChange}
                                value={this.props.category}
                            /&amp;gt;
                  &amp;lt;/div&amp;gt;
                &amp;lt;/div&amp;gt;
                &amp;lt;div className="category-input-item button p-1"&amp;gt;
                &amp;lt;/div&amp;gt;
              &amp;lt;/SettingRow&amp;gt;
            &amp;lt;/SettingSection&amp;gt;
          &amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
    )
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 13 Jun 2023 21:27:47 GMT</pubDate>
    <dc:creator>ShaunLangley</dc:creator>
    <dc:date>2023-06-13T21:27:47Z</dc:date>
    <item>
      <title>Redux store and the Settings Component</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/redux-store-and-the-settings-component/m-p/1298934#M7220</link>
      <description>&lt;P&gt;I've been trying for the last couple days to implement a redux store for my widget/application and I've observed a few things.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can successfully dispatch to and read from my redux store from within the runtime component of my widget, however when I try to do the exact same thing from inside my Settings component, I'm receiving 'state.myState' is undefined.&lt;/P&gt;&lt;P&gt;Has anyone been able to update their redux store from the Settings component of a widget?&lt;/P&gt;&lt;P&gt;&amp;nbsp;I've simplified my implementation example but I think this illustrates what I'm trying to accomplish&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;export default class Setting extends React.PureComponent&amp;lt;
AllWidgetSettingProps&amp;lt;IMConfig&amp;gt; &amp;amp; {
  category: string
}, {}
&amp;gt; {
  static mapExtraStateProps (state: IMState) {
    return {
      category: state.layerState.category
    }
  }

  onChange = (evt) =&amp;gt; {
    this.props.dispatch({
      type: 'ADD_CATEGORY',
      val: evt.target.value
    })
  }

  render () {
    return (
        &amp;lt;div&amp;gt;
          &amp;lt;div className="widget-setting-layerListPlus"&amp;gt;
            &amp;lt;SettingSection
                title="Data Category"
                role="group"
                aria-label="Data Category"
            &amp;gt;
              &amp;lt;SettingRow&amp;gt;
                &amp;lt;div className="category-input w-100 d-flex flex-column" &amp;gt;
                  &amp;lt;div className="category-input-item input"&amp;gt;
                            &amp;lt;Input
                                id="category-input"
                                onChange={this.onChange}
                                value={this.props.category}
                            /&amp;gt;
                  &amp;lt;/div&amp;gt;
                &amp;lt;/div&amp;gt;
                &amp;lt;div className="category-input-item button p-1"&amp;gt;
                &amp;lt;/div&amp;gt;
              &amp;lt;/SettingRow&amp;gt;
            &amp;lt;/SettingSection&amp;gt;
          &amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
    )
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2023 21:27:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/redux-store-and-the-settings-component/m-p/1298934#M7220</guid>
      <dc:creator>ShaunLangley</dc:creator>
      <dc:date>2023-06-13T21:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: Redux store and the Settings Component</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/redux-store-and-the-settings-component/m-p/1625638#M19414</link>
      <description>&lt;P&gt;The widget runtime and the setting run in different windows. To get the state in setting, can you try `state.appStateInBuilder.yourState`?&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jun 2025 08:39:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/redux-store-and-the-settings-component/m-p/1625638#M19414</guid>
      <dc:creator>JunshanLiu</dc:creator>
      <dc:date>2025-06-23T08:39:26Z</dc:date>
    </item>
  </channel>
</rss>

