<?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: How to get initial state in React Power BI cutom component with sync in Custom Visuals Development Discussion</title>
    <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/How-to-get-initial-state-in-React-Power-BI-cutom-component-with/m-p/3070847#M6844</link>
    <description>&lt;P&gt;I can't get filter from other page. When i have sync between pages with same dataset, update don't trigger. So i can't get jsonFilter in my constructor. I solving this by force tr igger update by applying new random json filter. This trigger calls update, where i can get jsonFilter and set new state for start and end dates&lt;/P&gt;</description>
    <pubDate>Thu, 09 Feb 2023 03:57:27 GMT</pubDate>
    <dc:creator>m1nato78lol</dc:creator>
    <dc:date>2023-02-09T03:57:27Z</dc:date>
    <item>
      <title>How to get initial state in React Power BI cutom component with sync</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/How-to-get-initial-state-in-React-Power-BI-cutom-component-with/m-p/3066356#M6809</link>
      <description>&lt;P class=""&gt;&lt;SPAN class=""&gt;I have a custom component ( DatePicker ) written in React. How to get initial data for multiple pages if components are synchronized via "supportsSynchronizingFilterState".&amp;nbsp;&lt;SPAN&gt;I need to get start date and end date. If I switch between pages, only the constructor is called&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 14:08:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/How-to-get-initial-state-in-React-Power-BI-cutom-component-with/m-p/3066356#M6809</guid>
      <dc:creator>m1nato78lol</dc:creator>
      <dc:date>2023-02-07T14:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to get initial state in React Power BI cutom component with sync</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/How-to-get-initial-state-in-React-Power-BI-cutom-component-with/m-p/3068318#M6825</link>
      <description>&lt;P&gt;You can use the filter state property of the custom component to retrieve the initial start date and end date. The filter state property is updated when the user changes the values in the date picker and can be used to pass the values to other components in the report.&lt;/P&gt;&lt;P&gt;Here's an example of how you can retrieve the initial start and end dates in the constructor of the custom component:&lt;/P&gt;&lt;P&gt;constructor(props) {&lt;BR /&gt;super(props);&lt;BR /&gt;const filterState = props.filterState;&lt;/P&gt;&lt;P&gt;let startDate = null;&lt;BR /&gt;let endDate = null;&lt;/P&gt;&lt;P&gt;if (filterState) {&lt;BR /&gt;startDate = filterState.startDate;&lt;BR /&gt;endDate = filterState.endDate;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;this.state = {&lt;BR /&gt;startDate,&lt;BR /&gt;endDate&lt;BR /&gt;};&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In this example, the filterState is passed as a property to the custom component and the start and end dates are retrieved from the filterState. If the filterState is not available, the start and end dates are set to null. The start and end dates are then set in the component's state.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2023 08:42:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/How-to-get-initial-state-in-React-Power-BI-cutom-component-with/m-p/3068318#M6825</guid>
      <dc:creator>jaweher899</dc:creator>
      <dc:date>2023-02-08T08:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to get initial state in React Power BI cutom component with sync</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/How-to-get-initial-state-in-React-Power-BI-cutom-component-with/m-p/3070847#M6844</link>
      <description>&lt;P&gt;I can't get filter from other page. When i have sync between pages with same dataset, update don't trigger. So i can't get jsonFilter in my constructor. I solving this by force tr igger update by applying new random json filter. This trigger calls update, where i can get jsonFilter and set new state for start and end dates&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 03:57:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/How-to-get-initial-state-in-React-Power-BI-cutom-component-with/m-p/3070847#M6844</guid>
      <dc:creator>m1nato78lol</dc:creator>
      <dc:date>2023-02-09T03:57:27Z</dc:date>
    </item>
  </channel>
</rss>

