<?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: Bojan Gvozderac</title>
    <description>The latest articles on DEV Community by Bojan Gvozderac (@irideveloper).</description>
    <link>https://dev.to/irideveloper</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%2F74174%2Fd304129e-01cf-4750-9dc8-3f52d00d9fcc.JPG</url>
      <title>DEV Community: Bojan Gvozderac</title>
      <link>https://dev.to/irideveloper</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/irideveloper"/>
    <language>en</language>
    <item>
      <title>Why Your Business Needs a Progressive Web App</title>
      <dc:creator>Bojan Gvozderac</dc:creator>
      <pubDate>Thu, 28 Jun 2018 14:39:48 +0000</pubDate>
      <link>https://dev.to/jsguru_io/why-your-business-needs-a-progressive-web-app-41ee</link>
      <guid>https://dev.to/jsguru_io/why-your-business-needs-a-progressive-web-app-41ee</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdelivery.eusi.cloud%2Fapi%2Fv1%2Ff1a4305c-e431-4668-ae4c-02f78c656a41%2Fmedia%2Fs3%2F1530179495083_JSG-PWA-Cover.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdelivery.eusi.cloud%2Fapi%2Fv1%2Ff1a4305c-e431-4668-ae4c-02f78c656a41%2Fmedia%2Fs3%2F1530179495083_JSG-PWA-Cover.png" alt="featured image"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;You ever look at a web site and think: "Everything is either a potato or not a potato…" and more ( or less? ) importantly: "This web site would be great as an app!"? If you did, you're not alone, buddy boy!&lt;/p&gt;

&lt;p&gt;Some very cool folks over at &lt;em&gt;Internet HQ&lt;/em&gt; ( don't fact check this just blindly believe that it exists ) that govern how the internet behaves agree with you ( the potato thing &lt;em&gt;AND&lt;/em&gt; the web site as an app thing! &lt;em&gt;WOW! Look at you go!&lt;/em&gt; ).&lt;br&gt;
They introduced a concept called Progressive Web App - PWA, for short.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;strong&gt;It's called Progressive Web App because it progressively gets better as you use it&lt;/strong&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;PWA = Progressive Web Awesome!&lt;/strong&gt;&lt;br&gt;
There are a couple of key things that'll make you want to rock out with PWAs&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Offline Mode&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Imagine this scenario.&lt;br&gt;
You're on a news site and just finished reading an article, at some point in time later you want to reread that same article or show it to somebody else but there's a catch!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;You don't have internet access!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If the article you want to read is on a non-PWA site you're EFFED and getting a big fat serving of "No internet connection" screen buuuuuut if the article is on a PWA site you'll be reading your article just fine.&lt;/p&gt;

&lt;p&gt;What PWAs can do is save the web pages you've visited and make them available even when you don't have internet access.&lt;br&gt;
To me this is a &lt;em&gt;game changer&lt;/em&gt;, it mitigates every web site's greatest weakness and, in some cases, completely nullifies it!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Push Notifications&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Lets take a look at another scenario.&lt;/p&gt;

&lt;p&gt;You own an e-commerce site and looking at your web site analytics reports you came to the conclusion that a lot of your visitors come to your online store, look at items, think about buying something, maybe even go through some of the purchase process and then just leave never to be seen again.&lt;/p&gt;

&lt;p&gt;What PWAs can do for you is send &lt;em&gt;push notifications&lt;/em&gt; that feel natural and look native to the device your visitors are using - even if the browser isn't open on their device - to let them know that the item they've been looking at earlier is, for example, discounted and with the click of a button can place them back in the purchase process where they've left off.&lt;/p&gt;

&lt;p&gt;The takeaway is clear.&lt;br&gt;
Having a PWA site is like having a sales person working around the clock on bringing you new customers or re-engaging with old ones, letting them know you still value their business.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;A really good example is Jumia. There's a link later in the blog, make sure you check it out.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Web Share&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In this scenario…&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I'm kidding! No scenario for this one. Phew!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;strong&gt;Kidding aside, the ability to share content between apps and platforms in the modern world is absolutely necessary.&lt;/strong&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Web share invokes the devices native share functionality, this means that any app or platform that has allowed sharing on it PWAs will be able to share content with that app or platform.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I lied we're gonna go through a scenario&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Say you own a business and sharing content is a key part of your online marketing strategy.&lt;br&gt;
When you first hired a web development studio they integrated Facebook and Twitter sharing and that was perfect at the time but later on your business has grown and expanded to, lets say, China. &lt;em&gt;Nice!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now you need to integrate sharing on WeChat. In order for you web development team to integrate WeChat they need to read the developer documentation ( which may or may not be translated to a language your developers are comfortable with ), next they need to write the code, after that they need to test if the new code works and also that it doesn't break any of the old functionality.&lt;/p&gt;

&lt;p&gt;All of this work costs money - hundreds if not thousands of dollars that could have gone somewhere else like marketing for your product.&lt;/p&gt;

&lt;p&gt;With PWAs all of this avoided because writing one sharing functionality covers all relevant platforms for your web app visitors.&lt;br&gt;
&lt;em&gt;Share away my wayward son!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Cuts Costs&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In most cases businesses don't need anything more than a web site to be present and relevant online but in other cases they need a small part of functionality that is reserved only for native devices.&lt;/p&gt;

&lt;p&gt;This &lt;em&gt;forced&lt;/em&gt; businesses to invest in costly native apps for both Android and iOS which can cost anywhere between $20 000 and $120 000.&lt;/p&gt;

&lt;p&gt;PWAs want to solve this by making web sites more like native apps and extending their functionality with device native features, as a result it cuts costs significantly because companies now have to develop only for one platform instead of three.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thanks PWA!&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;&lt;strong&gt;Progressive Web Apps turn a boring old web site that's just THERE to an indispensable tool for converting visitors to clients&lt;/strong&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1600%2F0%2AaQfUDPQI2r-UUG-X.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1600%2F0%2AaQfUDPQI2r-UUG-X.png" alt="success stories image"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Success Stories&lt;/em&gt;&lt;br&gt;
Still not convinced that PWAs are the sauce of awesome? Fine, lets ask these upstanding businesses:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;AliExpress ( &lt;a href="https://developers.google.com/web/showcase/2016/aliexpress" rel="noopener noreferrer"&gt;LINK&lt;/a&gt; )&lt;/em&gt;&lt;br&gt;
Aliexpress is a popular e-commerce site that lets you order items directly from China.&lt;/p&gt;

&lt;p&gt;After migrating their site to PWA these are the results they saw:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;104% for new users across all browsers; 82% increase in iOS conversion rate&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;2X more pages visited per session per user across all browsers&lt;/li&gt;
&lt;li&gt;74% increase in time spent per session across all browsers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Jumia ( &lt;a href="https://developers.google.com/web/showcase/2016/jumia" rel="noopener noreferrer"&gt;LINK&lt;/a&gt; )&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Jumia is a leading e-commerce site in Africa. I'm gonna highlight the challenge that they faced ( taken from the LINK above )&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Nearly a quarter of shopping carts were abandoned on Jumia's mobile site every day.&lt;br&gt;
To counter this, they reminded customers via email to complete their purchases. But getting people to provide their email addresses is challenging, and email open rates are low. With over 65% of their web traffic on mobile browsers, Jumia looked to progressive web app technologies like Push Notifications to solve their problem and re-engage mobile users who had abandoned carts.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What PWA did for them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;38% Open rate&lt;/li&gt;
&lt;li&gt;9X more conversion on previously abandoned carts from web push users&lt;/li&gt;
&lt;li&gt;7.85% conversion rate on previously abandoned carts from web push users, vs. 4.5% for native app&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Twitter ( &lt;a href="https://developers.google.com/web/showcase/2017/twitter" rel="noopener noreferrer"&gt;LINK&lt;/a&gt; )&lt;/em&gt;&lt;br&gt;
C'mon… I'm not gonna explain Twitter to you, you know what it is.&lt;/p&gt;

&lt;p&gt;Twitters PWA became the default web experience on mobile devices in April 2017.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note from the Engineering Lead:&lt;br&gt;
Twitter Lite is now the fastest, least expensive, and most reliable way to use Twitter.&lt;br&gt;
The web app rivals the performance of our native apps but requires less than 3% of the device storage space compared to Twitter for Android.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Results:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;65% increase in pages per session&lt;/li&gt;
&lt;li&gt;75% increase in Tweets sent&lt;/li&gt;
&lt;li&gt;20% decrease in bounce rate&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;You Want a Piece of This?!&lt;br&gt;
So you saw the greatness of PWA and want to get in on the action.&lt;br&gt;
You could spend months learning the necessary technology and how to write PWA code or you could head on over to &lt;a href="//jsguru.io"&gt;jsguru.io&lt;/a&gt; and let us do all the heavy lifting for you.&lt;/p&gt;




&lt;p&gt;Before you go…&lt;br&gt;
If you enjoyed reading this post please share it. You should check out our other publications, you might like them too! We write from time to time about software development, tips and tricks, and how to become a better developer and business person in general. Join us on the journey of constant improvement!&lt;/p&gt;

&lt;p&gt;Follow us on &lt;a href="https://www.facebook.com/jsguruio/" rel="noopener noreferrer"&gt;Facebook&lt;/a&gt;, &lt;a href="https://twitter.com/jsguru_software" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;, &lt;a href="https://www.linkedin.com/company/jsguru" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;, &lt;a href="https://medium.com/jsguru" rel="noopener noreferrer"&gt;Medium&lt;/a&gt; or &lt;a href="https://dev.to/jsguru_io"&gt;DEV.to&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;Originally published at &lt;a href="//jsguru.io"&gt;jsguru.io&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>progressivewebapps</category>
      <category>business</category>
      <category>webdev</category>
      <category>startup</category>
    </item>
    <item>
      <title>Restpollo - React Fetch Component</title>
      <dc:creator>Bojan Gvozderac</dc:creator>
      <pubDate>Thu, 14 Jun 2018 10:21:03 +0000</pubDate>
      <link>https://dev.to/irideveloper/restpollo-react-fetch-component-390k</link>
      <guid>https://dev.to/irideveloper/restpollo-react-fetch-component-390k</guid>
      <description>&lt;h2&gt;
  
  
  &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--z2ogS0Ti--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/eju37rmm70c11s5cy4wp.png" alt="cover image"&gt;
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;DISCLAIMER: Restpollo isn't an official Apollo project. They did such a good job with React Apollo that it inspired me to create a simplified version for communicating with a REST API using React components and function as children  pattern.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I don't hide the fact that I'm a &lt;strong&gt;&lt;strong&gt;HUGE&lt;/strong&gt;&lt;/strong&gt; fan of React ( &lt;a href="https://reactjs.org/"&gt;LINK&lt;/a&gt; ), GraphQL ( &lt;a href="https://graphql.org/"&gt;LINK&lt;/a&gt; ), Apollo ( &lt;a href="https://www.apollographql.com/"&gt;LINK&lt;/a&gt; ) and Apollo's React components ( &lt;a href="https://www.apollographql.com/docs/react/"&gt;LINK&lt;/a&gt; ).&lt;br&gt;
When Apollo React rolled out version 2.1 they introduced components for querying, mutating and subscribing to a GraphQL backend… this blew me away!&lt;br&gt;
Here's an example ( taken from Apollo React documentation - &lt;a href="https://www.apollographql.com/docs/react/react-apollo-migration.html"&gt;LINK&lt;/a&gt; ):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Query&lt;/span&gt; &lt;span class="nx"&gt;query&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;GET_DOGS&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;{({&lt;/span&gt; &lt;span class="nx"&gt;loading&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;Error&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;loading&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Fetching&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;DogList&lt;/span&gt; &lt;span class="nx"&gt;dogs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dogs&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;}}&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Query&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's go over the code above in detail.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Query&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;Query&amp;gt;&lt;/code&gt; is a React Apollo component that takes in a GraphQL query as a prop and then starts to work it's magic.&lt;br&gt;
It goes to the GraphQL backend and fetches the data we've requested ( defined in GET_DOGS in our example ), it also handles a couple of common states along the way:&lt;br&gt;
&lt;strong&gt;loading&lt;/strong&gt; - the request is sent but we haven't received a response yet&lt;br&gt;
&lt;strong&gt;error&lt;/strong&gt; - something went wrong trying to retrieve data&lt;br&gt;
&lt;strong&gt;data&lt;/strong&gt; - fetch data succeeded!&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;The cool part&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The really cool part about &lt;code&gt;&amp;lt;Query&amp;gt;&lt;/code&gt; ( and other Apollo React components ) is how it handles rendering the UI with function as children pattern ( &lt;a href="https://medium.com/merrickchristensen/function-as-child-components-5f3920a9ace9"&gt;LINK&lt;/a&gt; ).&lt;br&gt;
This means you get all of the yummy Apollo React functionality without it assuming how you want to render your data! Awesome!&lt;/p&gt;




&lt;h1&gt;
  
  
  &lt;strong&gt;REST meets Apollo&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;Because I had so much fun with Apollo's React components I thought how great it would be if something like Apollo React existed for communicating with a REST API.&lt;br&gt;
After an &lt;strong&gt;&lt;strong&gt;EXHAUSTING&lt;/strong&gt;&lt;/strong&gt; research session ( googled "apollo rest" and saw that the first result wasn't what I wanted ), I decided to build my own Apolloesque React components for REST API's!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Is it derivative? Yes. Will I get sued by Apollo? Also yes but I'm hoping they think I'm cute and don't take legal actions &amp;lt;&lt;em&gt;fingers crossed&lt;/em&gt;&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;What's in the box?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The hero of our story is &lt;code&gt;&amp;lt;Fetch&amp;gt;&lt;/code&gt; which takes in 2 props 'url' and 'fetchOptions' and does it's magic will allowing you to write your own render logic using function as children, just like Apollo React.&lt;br&gt;
The sidekicks to our hero are &lt;code&gt;&amp;lt;Get&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;Post&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;Put&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;Delete&amp;gt;&lt;/code&gt; which are nothing more than syntactic sugar on top of &lt;code&gt;&amp;lt;Fetch&amp;gt;&lt;/code&gt; that have defaults defined for common REST actions.&lt;br&gt;
And now the goodies!&lt;br&gt;
&lt;a href="https://irideveloper.github.io/restpollo/"&gt;Examples site link&lt;/a&gt; - This is where you can see how the components work with some simple layout and styling&lt;br&gt;
&lt;a href="https://github.com/IRIdeveloper/restpollo"&gt;Github link&lt;/a&gt; - If you want to check out the code this is the link for you &amp;lt;&lt;em&gt;finger point emoji&lt;/em&gt;&amp;gt;&lt;br&gt;
&lt;a href="https://www.npmjs.com/package/react-restpollo"&gt;npm link&lt;/a&gt; - c'mon you know what this is&lt;/p&gt;




&lt;h1&gt;
  
  
  &lt;strong&gt;The "Be my friend section"&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;If you liked this post and want to be friends with me, ya know, chat online or grab a beer or go on a life changing adventure that will bond us for the rest of our lives, you can find me on here:&lt;br&gt;
&lt;a href="https://github.com/IRIdeveloper"&gt;Github&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.linkedin.com/in/gvozderacbojan/"&gt;Linkedin&lt;/a&gt;&lt;br&gt;
&lt;a href="https://medium.com/@bojangbusiness"&gt;Medium&lt;/a&gt;&lt;br&gt;
&lt;a href="https://twitter.com/GvozderacBojan"&gt;Twitter&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>rest</category>
      <category>api</category>
      <category>fetch</category>
    </item>
    <item>
      <title>React image lazy load component Revisited</title>
      <dc:creator>Bojan Gvozderac</dc:creator>
      <pubDate>Thu, 24 May 2018 08:06:31 +0000</pubDate>
      <link>https://dev.to/jsguru_io/react-image-lazy-load-component-revisited-4dej</link>
      <guid>https://dev.to/jsguru_io/react-image-lazy-load-component-revisited-4dej</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F3s28bia94sk35q3v5487.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F3s28bia94sk35q3v5487.png" alt="title image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A long a$$ time ago I created a simple React component that would lazily load an image and while it’s busy loading an image it would show a placeholder and wrote a tutorial how I did it. It is inspired by Polymer’s iron-image and a neat little trick how to transition from placeholder to loaded image.&lt;/p&gt;

&lt;p&gt;The Magic&lt;br&gt;
While playing around with Polymer (shameless &lt;a href="https://medium.com/jsguru/polymer-tonnes-of-potential-not-quite-there-yet-f7516a65c96d" rel="noopener noreferrer"&gt;LINK&lt;/a&gt; to another article I wrote) I learned that you can make a pretty cool “Blur Up” animation by taking the image you want to show, scaling it down to 1% of its width and height, using that as the placeholder and when the original size image is done loading you fade it in over the placeholder.&lt;/p&gt;

&lt;p&gt;This creates an effect that looks like a blurred image hinting what it’s supposed to show suddenly sharpening to reveal the original image.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F6fxt34nkz0pc3qd028ky.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F6fxt34nkz0pc3qd028ky.gif" alt="bad@$$ demo gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sweet!&lt;br&gt;
The Reaction&lt;br&gt;
He he… see what I did there? The title is The Reaction and we’re talking about a React component! …I’m sorry you had to read that.&lt;br&gt;
When I released my component into the wild I thought it wouldn’t be interesting to a lot of people since it’s a relatively basic component but to my surprise the interest for my component started growing and growing.&lt;/p&gt;

&lt;p&gt;Thanks React community! Appreciate it!&lt;br&gt;
The article I wrote keeps getting views and claps and according to medium statistics the activity is coming mostly from google search!&lt;/p&gt;

&lt;p&gt;It made me really happy that I found a topic that continues to interest the React dev community and that I offered a possible solution to a problem as well as shared some of my knowledge.&lt;/p&gt;

&lt;p&gt;The Realization&lt;br&gt;
Looking at everything that’s happening something dawned on me…&lt;/p&gt;

&lt;p&gt;While the article explaining the concept behind image lazy load and the neat trick I learned from Polymer is cool, the component it self sucked big time.&lt;/p&gt;

&lt;p&gt;That’s why I decided to rework the component and publish it on npm as a library!&lt;/p&gt;

&lt;p&gt;The Good Stuff&lt;br&gt;
If you’re lookin’ for that sweet sweet component to use in your sweet sweet project then head on over to sweet sweet npm and install it (sweet sweet &lt;a href="https://www.npmjs.com/package/react-image-lazy-load-component" rel="noopener noreferrer"&gt;LINK&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;If you’re looking for the Github page you can find it here (&lt;a href="https://github.com/jsguru-io/react-image-lazy-load" rel="noopener noreferrer"&gt;LINK&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Before you go…&lt;br&gt;
If you enjoyed reading this post please share it. You should check out our other publications, you might like them too! We write from time to time about software development, tips and tricks, and how to become a better developer and business person in general. Join us on the journey of constant improvement!&lt;/p&gt;

&lt;p&gt;Follow us on &lt;a href="https://www.facebook.com/jsguruio/" rel="noopener noreferrer"&gt;Facebook&lt;/a&gt;, &lt;a href="https://twitter.com/jsguru_software" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;, &lt;a href="https://www.linkedin.com/company/jsguru" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;, &lt;a href="https://medium.com/jsguru" rel="noopener noreferrer"&gt;Medium&lt;/a&gt; or &lt;a href="https://dev.to/jsguru_io"&gt;DEV.to&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Originally published at &lt;a href="https://jsguru.io/blog/React-image-lazy-load-component-Revisited" rel="noopener noreferrer"&gt;jsguru.io&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>webdev</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
