<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Milad Heydari on Medium]]></title>
        <description><![CDATA[Stories by Milad Heydari on Medium]]></description>
        <link>https://medium.com/@iammilaad?source=rss-ef87b86356e1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*pYPv0G3WUtpA8SIUAoy9Sg@2x.jpeg</url>
            <title>Stories by Milad Heydari on Medium</title>
            <link>https://medium.com/@iammilaad?source=rss-ef87b86356e1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 00:05:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@iammilaad/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Async React Component]]></title>
            <link>https://medium.com/@iammilaad/react-async-component-f196bee3b155?source=rss-ef87b86356e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/f196bee3b155</guid>
            <category><![CDATA[codesplit]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[asyncawait]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Milad Heydari]]></dc:creator>
            <pubDate>Wed, 02 May 2018 10:58:08 GMT</pubDate>
            <atom:updated>2018-05-04T00:48:49.766Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4_l3u3RaDn3XKFDjDXcP-w.jpeg" /></figure><p>In front end the size of bundle is always important, specially when your project is enterprise and you have too many components and pages in your code. the bundle size of most project is about 2MB ( without Gzip) but in large projects maybe this size increased to 10 MB and it&#39;s too large! you need to decrease this size because your customers will absolutely run away from your webApp. you have to keep down bundle size of your project normally.</p><p>The best way to keep down the size of your bundle in ReactJS project is Async Component!You just need to use <strong>async/await</strong> in compoentDidMount.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b4a1c03ed03639ab89c76bd7f92030c9/href">https://medium.com/media/b4a1c03ed03639ab89c76bd7f92030c9/href</a></iframe><p>In this way when user come to one page in your project, just load js codes in this page. you just need to use this component in react router like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9210bfe0e0ff4afc06d20a3848e6c024/href">https://medium.com/media/9210bfe0e0ff4afc06d20a3848e6c024/href</a></iframe><blockquote><strong>Tip</strong> : when you use <strong>async/await </strong>you must add<strong> transform-async-to-generator</strong> in your babel.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f196bee3b155" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>