<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Web Dev on Omar Shabana</title><link>https://mirohhh.github.io/site/tags/web-dev/</link><description>Recent content in Web Dev on Omar Shabana</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Wed, 18 Mar 2026 23:53:55 +0200</lastBuildDate><atom:link href="https://mirohhh.github.io/site/tags/web-dev/index.xml" rel="self" type="application/rss+xml"/><item><title>React's useEffect hook</title><link>https://mirohhh.github.io/site/posts/my-third-post/</link><pubDate>Wed, 18 Mar 2026 23:53:55 +0200</pubDate><guid>https://mirohhh.github.io/site/posts/my-third-post/</guid><description>&lt;p&gt;React&amp;rsquo;s &lt;code&gt;useEffect&lt;/code&gt; hook is a powerful tool for managing side effects in functional components. It allows you to perform tasks like data fetching, subscriptions, or manual DOM manipulations after the component has rendered.&lt;/p&gt;
&lt;h3 id="basic-syntax"&gt;Basic Syntax&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;useEffect&lt;/code&gt; hook accepts two arguments: a function for the effect and an optional array of dependencies.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-javascript" data-lang="javascript"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;useEffect&lt;/span&gt;(() =&amp;gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;// Side effect logic goes here
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}, [&lt;span style="color:#a6e22e"&gt;dependencies&lt;/span&gt;]);
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="dependency-behaviors"&gt;Dependency Behaviors&lt;/h3&gt;
&lt;p&gt;The way &lt;code&gt;useEffect&lt;/code&gt; triggers depends on the dependency array provided:&lt;/p&gt;</description></item></channel></rss>