<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Armands</title>
    <description>The latest articles on DEV Community by Armands (@armandsuiska).</description>
    <link>https://dev.to/armandsuiska</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F283909%2Fbcadf8b0-3e71-4a50-82af-d22c40c800ca.jpeg</url>
      <title>DEV Community: Armands</title>
      <link>https://dev.to/armandsuiska</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/armandsuiska"/>
    <language>en</language>
    <item>
      <title>Reactjs - useEffect</title>
      <dc:creator>Armands</dc:creator>
      <pubDate>Mon, 02 Dec 2019 14:05:50 +0000</pubDate>
      <link>https://dev.to/armandsuiska/reactjs-useeffect-5h2n</link>
      <guid>https://dev.to/armandsuiska/reactjs-useeffect-5h2n</guid>
      <description>&lt;p&gt;Hi, I have some questions about reactjs useEffect hook.&lt;/p&gt;

&lt;p&gt;if in my function component I write something like this:&lt;/p&gt;

&lt;p&gt;const [myValue, setMyValue] = useState("initialValue");&lt;br&gt;
useEffect(() =&amp;gt; { console.log("Call this one time"); }, []);&lt;br&gt;
useEffect(() =&amp;gt; { console.log("Call when data changed"); }, [myValue]);&lt;/p&gt;

&lt;p&gt;When I render component for first time I get both console logs. But WHY? When I pass empty array react knows that it should execute this callback once. Why it checks passed array values in initial rendering? Now it is not possible to execute second effect only when data has changed...&lt;/p&gt;

</description>
      <category>react</category>
    </item>
  </channel>
</rss>
