<?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 Prashant Gupta on Medium]]></title>
        <description><![CDATA[Stories by Prashant Gupta on Medium]]></description>
        <link>https://medium.com/@prashantg9912?source=rss-2db2e0b884ee------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*nR1RxYi-uzeJ8Epb.</url>
            <title>Stories by Prashant Gupta on Medium</title>
            <link>https://medium.com/@prashantg9912?source=rss-2db2e0b884ee------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 21:29:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@prashantg9912/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[Front-End Development Coding Style For Production Application ✨]]></title>
            <link>https://medium.com/@prashantg9912/front-end-development-coding-style-for-production-application-8abc93af8a93?source=rss-2db2e0b884ee------2</link>
            <guid isPermaLink="false">https://medium.com/p/8abc93af8a93</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[code-quality]]></category>
            <dc:creator><![CDATA[Prashant Gupta]]></dc:creator>
            <pubDate>Fri, 11 Aug 2023 04:00:03 GMT</pubDate>
            <atom:updated>2023-08-11T04:49:12.024Z</atom:updated>
            <content:encoded><![CDATA[<p>Working on UI for a few years has taught me a lot about building and delivering products to users. When I first started, I developed applications on my own. But once I joined a team, I realized that my code quality was poor. I kept repeating the same code in different places, and it became hard to maintain.</p><p>Looking back at my code after two years, I saw how bad it was and how difficult it was to make changes or understand it. Over these two years, I’ve learned a lot about how teams work and the importance of maintaining good code quality while delivering a product with great features.</p><p>I now understand that code quality is crucial because other developers may work on your code, and it should be easy for them to understand and work with. It’s better to keep the code simple rather than make it needlessly complex. Also, I’ve realized that our work is not just about shipping a product with rich features, but also about delivering high-quality code that is easy to maintain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*R3BKA0nDvQYQk1zvO-j-Iw@2x.jpeg" /></figure><h4><strong>Why Code quality is important?</strong></h4><ul><li>Many other developers may work on your code, so it should be easy for them to understand and use.</li><li>Simplify the logic and avoid unnecessary complexity in your code.</li><li>Remember that your first code will not be the final version, as there will always be new features or improvements. Code with future changes in mind.</li></ul><p><em>These points are relevant to all frontend programming languages, like</em><strong><em> Angular, React JS, or Vue JS.</em></strong></p><h4>Understanding the Abstraction Layer</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aHyjzovLIEUacfJ91FYVFQ.png" /></figure><p>Abstract components are very important when maintaining the code for the long run, there are many advantages when it comes to using abstract components i.e. Modularity, Reuseblility, Consistency, Scalability, Collaborating &amp; etc.</p><p>In the frontend world, we can create reusable components; but that is not enough. An abstract component can have the core logic of the component inside and can be extended to have a specific version of that component in your code.</p><p>Here’s an example of a<strong> Button Component.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FCdOvZW0hGt4ktA9xrRbHg.png" /></figure><p>Abstract Button Component can contain all the core logic of your button and Button Component v1 &amp; v2 are derived components for specific use cases.</p><p>If you now want to have a new button then you can create a new v3 Button component with a new look and feel keeping the core button logic intact. And if you want to make changes to the core then you can easily do it in the abstract component and it will change it for all v1,v2 &amp; v3.</p><p>This aspect holds immense importance in component creation, ensuring both consistency and maintainable code. As a front-end engineer, your role involves more than just delivering; it encompasses delivering high-quality code that is easily maintainable.</p><h4><strong>Understand Plug and Playable Components</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*TwncP9hzuS90GvrOogwpdA.png" /></figure><p>I have seen that most of the production code is so tightly bound that removing old features and implementing new ones becomes a nightmare. When writing a component, we need to make sure that they are easy to replace.</p><p>A perfect example of it is to define <strong>Smart and Dumb Components </strong>in your code. Smart Components could be the container or wrapper that holds the main logic of the application, <strong>whereas dumb components will only display data or take input, without performing any heavy logic.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ftCH-ZWPtHGfclVaP-wCoA.png" /></figure><p>In this above image, as a product page of an e-commerce website, we define parent containers in the red dash as <strong>Smart components </strong>which handle heavy logic, and all the other small components inside are <strong>Dumb components, </strong>these dumb components do nothing but take input/show output to the user.</p><p>So now when you click on the “<strong>Add to Cart</strong>” the button sends the callback to its parent smart component and from there we can call the API service class.</p><p>The major advantage of this design pattern is we can easily remove/replace these dumb components and will create the least dependency on your application.</p><p><strong>One could argue, why can’t we directly call service or redux from these dumb components? </strong>The answer is, if you want to change the Redux store to mobX store(react world 🌎) or migrate the service to a different service(angular world 🌎) then again you create dependency. So we are keeping the heavy logic to the Smart component and will separate out the UI component from the logic, hence we can replace anything very smartly and easily.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4c5JGjlOhE-VJIAdY2WomQ.png" /></figure><blockquote>In this way, we can easily remove and replace these dump components altogether if we introduce a new feature.</blockquote><h4>Defined Coding Standards &amp; Invite Team to collaborate</h4><p>Define and adhere to coding standards and style guides for your project. Consistent code formatting and naming conventions make the codebase more readable and maintainable.</p><p>A perfect example of it is to have design and discussion if you working in a team, definitely. you want input from others as well.</p><p><strong>Maintain a Readme/document </strong>of all the major coding patterns you using in the code; this will also come in handy when you go back into your code years later to maintain it.</p><h4>Use JSDoc</h4><p>Utilize JSDoc standards to comprehensively document the functionality of your code. This way, when you revisit the code after a few months, you can easily grasp its purpose without the need to read through the entire codebase.</p><pre>/**<br> *  Retrieves name from user&#39;s id.<br> *  @param {string} id of the user.<br> *  @returns {string} name of the user.<br> */<br>const getNamefromId = (email) =&gt; {</pre><pre>}</pre><h4>Define Eslint</h4><p>ESLint can be used to analyze and identify potential issues, coding style violations, and errors in your JavaScript/Typescript code. This helps ensure that the codebase follows a consistent style and adheres to best practices. One of the best dev tools is to have your code ESlinted this will give efficiency.</p><p>The simple way to start using Eslint is</p><blockquote><em>npm install eslint-config-prettier eslint-plugin-prettier prettier — save-dev</em></blockquote><p>Then create file<strong> .eslintrc.json</strong></p><blockquote>{ “extends”: [ “eslint:recommended”,”plugin:prettier/recommended” ]}</blockquote><p>The interesting part is that you can have additional plugins added to the config which will make your developing job much easier. Here is a list of the best eslint <a href="https://github.com/dustinspecker/awesome-eslint">plugins</a>.</p><h4><strong>Keep up to date with the latest Framework versions!</strong></h4><p>There are many amazing features the team is releasing with every update, if you look at Angular there are some awesome features like s<strong>tandalone components &amp; signals released in recent releases.</strong></p><p>Check out the angular releases page <a href="https://angular.io/guide/releases">https://angular.io/guide/releases</a></p><p>React too releases v18 with some awesome features like <strong>Streaming Server-side rendering &amp; Automatic Batching 🔥</strong></p><p>Check out react release blog <a href="https://react.dev/blog/">https://react.dev/blog/</a></p><blockquote>New features give more efficiency and opportunity to your product, whether we are talking about app performance or code maintainability which are both important to have as a production product.</blockquote><h3><strong>Keep UI Light</strong></h3><p>JavaScript is inherently designed to be lightweight and efficient. I&#39;ve previously highlighted it in my other article (<a href="https://medium.com/@prashantg9912/how-nextjs-13-4-will-change-front-end-development-883546209786">Next.js 13.4: A Game-Changer for Front-End Development!</a>). Javascript is single-threaded means it&#39;s developed to be lightly weighted.</p><p>If you develop heavy-time complex logic or try to integrate a lot of npm libraries, then it will give the user a hard time in production application. Indeed, the bundle size will expand, and as a result, the user’s browser will need to tackle a multitude of complex tasks.</p><blockquote><strong>Rule for Integrating External Library: </strong>Avoid adding an external library just for a single use. If you can achieve the task using vannilla JavaScript, It’s simpler and more lightweight.</blockquote><h4><strong>Understand the concept of Tree Shaking</strong></h4><p>Tree shaking is a term commonly used within a JavaScript context to describe the removal of dead code.</p><p>The tree-shaking concept is very important if you are building a heavy UI project and have a lot of dependencies that you can’t remove directly.</p><pre>const lodash = require(&#39;lodash&#39;); // heavy<br><br>//instead use 👇🏼<br><br>import isArray from &#39;lodash/isArray&#39;; // light</pre><h3><strong>Conclusion</strong></h3><p>To sum up, adopting these front-end coding practices enhances efficiency and maintainability. Prioritizing code quality, adhering to standards, and leveraging tools like Eslint create a strong foundation. By staying updated, smartly integrating libraries, and optimizing design, we create user-friendly interfaces. Balancing simplicity and functionality, we ensure our code stands the test of time, delivering exceptional experiences to users.</p><p>There are numerous key areas where we can make improvements. Feel free to let me know in the comments if I’ve overlooked any.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8abc93af8a93" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Next.js 13.4: A Game-Changer for Front-End Development!]]></title>
            <link>https://medium.com/@prashantg9912/how-nextjs-13-4-will-change-front-end-development-883546209786?source=rss-2db2e0b884ee------2</link>
            <guid isPermaLink="false">https://medium.com/p/883546209786</guid>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[nextjs-vs-react]]></category>
            <dc:creator><![CDATA[Prashant Gupta]]></dc:creator>
            <pubDate>Sat, 13 May 2023 21:28:10 GMT</pubDate>
            <atom:updated>2024-02-16T05:05:39.061Z</atom:updated>
            <content:encoded><![CDATA[<h3>Next.js 14: A Game-Changer for Front-End Development!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FSlNgwk9RtnlAQldDh_EiQ.png" /></figure><p>Vercel recently released the NextJs 14 <a href="https://nextjs.org/blog/next-14">Stable</a> version as a serve-client front-end framework.</p><p>But we are more interested how this will change the web development flow. 😉</p><p>Many people will compare it with Php or will say <strong>“This is what we were doing in PHP 10 years ago”</strong>, the answer is a bit complicated.</p><p>PHP is indeed a server-side programming language, primarily used for server-side processing and generating dynamic web content. By itself, PHP doesn’t directly interact with the front-end or provide client-side interactivity. To achieve front-end interaction or real-time updates, additional technologies like Ajax or JavaScript are typically used in conjunction with PHP.</p><h3>PHP Vs Modern JS Framworks/Libraries ?</h3><p>When React was released people were excited to learn and develop apps into it, since we can now make a single-page app; which is best for React to handle. How React work is by letting you write your logic in the ship the complete bundle to the user’s browser. Now the question comes what happens once you start filling with multiple libraries or your code base starts increasing? <strong><em>Your production bundle size will also start growing which will give a hard time for users to ship.</em></strong></p><p>During my journey of learning React, I undertook a project and ensured its readiness for production. Initially, it was a basic React project without any additional frameworks or libraries. However, as the code base expanded and I integrated external libraries, the bundle size gradually increased. Unfortunately, this led to complaints from users regarding noticeable sluggishness on mobile devices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6I8OkJiSYkagfSJFbIYP8Q.jpeg" /></figure><p>Now React introduced the concept of <a href="https://legacy.reactjs.org/docs/code-splitting.html">code-splitting</a>, where we can split these bundles and lazy load them. Fine, we can solve the bundling with code-splitting &amp; one can argue we can cache some bundle or file to the user’s machine so it won&#39;t download it back, which is perfect for solving slowness or website loading issues.</p><p>Now the question arises: how can one manage the processing of JavaScript code? 🤕 As our codebase grows larger, it can undoubtedly have an impact on the loading speed of a JavaScript engine. When a JavaScript file is loaded by a browser, the engine needs to parse and interpret the code before executing it. The larger the codebase, the more time it takes for the engine to process and load the JavaScript file.</p><p>As we are aware, JavaScript is a single-threaded language specifically designed to be lightweight, allowing it to run smoothly on users’ browsers. Instead of delivering hefty software packages, a web-based approach involves shipping a lightweight user interface while keeping the logic on the backend. This is one of the compelling reasons why major companies are transitioning their software to web-based platforms.</p><p>Now the problem comes when you start making UI code heavy with more complex logic and heavy rendering and then ship it to production. Code splitting/caching won&#39;t solve this problem. Your single-threaded language is doing multiple tasks like fetching, data rendering, logic processing, etc. &amp; it&#39;s all happening on the user’s machine.</p><p>PHP solved this issue by pre-rendering most of the logic on the server and shipping it to the user’s machine, a good reason why it&#39;s one of the popular languages. However, it’s worth noting that PHP’s main strength lies in server-side processing and generating HTML content. For more interactive and dynamic browser behavior, JavaScript is commonly used in conjunction with PHP. <strong>JavaScript, being a client-side scripting language, can handle real-time browser events, manipulate the DOM, and provide a more interactive user experience.</strong> A very good reason why react, angular, or other JS libraries/frameworks are popping up. Written in javascript we can design more interactive forms/website/application which makes users more pleasing 😉.</p><p><strong>But aren’t we just going back and forth?</strong></p><h3><strong>How NextJs 13 solves this issue?</strong></h3><p>With NextJs 13, every component you write is by default a server component. You can make it a client-side component by writing it as ‘use-client’ on top of the file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zx21LqmsBNAAaXurrjW8vQ.png" /></figure><p>Now according to <a href="https://nextjs.org/docs/getting-started/react-essentials#server-components">NextJs docs</a>, we should make interactive components as client components and other to server components, just like the image mentioned above.</p><p>Now let&#39;s discuss how NextJs 13 is solving the issues mentioned above. Client-side rendering, brings whole new possibilities; <strong>means now we can move heavy UI logic like data-fetching, pre-rendering &amp; complex js logic to the server side and ship only light weighted UI to the user’s browser. </strong>All of these things can be written in Javascript.</p><p>Additionally, Next.js 14 simplifies the development process with its built-in functionalities such as Server-Side Generation (SSG), Server-Side Rendering (SSR), and Client-Side Rendering (CSR). These features can be seamlessly incorporated into the workflow without requiring extensive knowledge, resulting in leaner and more comprehensible code compared to earlier versions of Next.js.</p><h3><strong>My Final Conclusion</strong></h3><p>In summary, Next.js 14 brings about significant advancements in web development by offering a comprehensive solution for server-side and client-side rendering. By leveraging the strengths of JavaScript and server-side processing, it provides a more efficient and interactive user experience while addressing performance concerns associated with large codebases.</p><p>There can be multiple perspectives on this topic, but I believe we are undoubtedly benefiting from languages like PHP and Ruby on Rails in our learning process.</p><p>Additionally, we may encounter certain UI libraries that may not function as expected with Next14 or require an upgrade. Nevertheless, I am confident that we are progressing in the right direction.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=883546209786" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I made Beautiful Curved Bottom Navigation in React Native]]></title>
            <link>https://medium.com/@prashantg9912/how-i-made-beautiful-curved-bottom-navigation-in-react-native-b60832cb2375?source=rss-2db2e0b884ee------2</link>
            <guid isPermaLink="false">https://medium.com/p/b60832cb2375</guid>
            <category><![CDATA[navigation]]></category>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[animation]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Prashant Gupta]]></dc:creator>
            <pubDate>Wed, 11 Mar 2020 20:03:44 GMT</pubDate>
            <atom:updated>2020-03-11T20:03:44.955Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Curved bottom navigation bar in react native" src="https://cdn-images-1.medium.com/max/784/1*08J17FVCWe2DW_NGkJbFhw.gif" /><figcaption>My final product in React native, continue reading full story :P</figcaption></figure><p>One fine day, my friend showed me the library that how he is using this awesome <a href="https://pub.dev/packages/curved_navigation_bar#-readme-tab-">curved navigation</a> in a flutter. To be honest, his app was looking quite nice.</p><p>I searched for a similar library but couldn’t find any of it 😕. So I thought why wouldn’t I just make it on my own.</p><p>Flutter is around the app development sphere quite recently, and the potential is growing quite well. But, since I started React native 7 months ago, I just fall in love with the development and coding part of react, which not to be mentioned are reusability, state management, props. I know there are a lot of things in react and native, but I just found these things so much fascinating.</p><p>After I discovered animations and interpolate features in React native, I was very curious to explore them and want to make something cool. And that day I just brainstormed how that flutter thing is working and I came with a solution to make it happen.</p><p>I started searching on the solution on how to make it happen and came to video on youtube similar to that one. But, I was not satisfied with his version.</p><p>It looks like this,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*Yx8ylCqJaave3ATe_3L5uA.png" /><figcaption>He did a great job but I want something more…</figcaption></figure><h3>So let’s begin,</h3><p>The first thing which came to my mind is to make the shape like that cool curve. There were 2 solutions that I thought, first to use SVGs and the other is to use Views 😜.</p><p>I worked with SVGs before, but I just not comfortable with it and found it quite difficult. So, I thought to give just Views a try.</p><p>So, I made a photoshop wireframe of the logic I need to apply and made something like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/0*Ca1ZM06-4ThxevMI.png" /></figure><p>If you observe carefully, you can see a similar curve that I want to make it. And if, you crop of red part from the yellow part it will look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/0*TRd7cDcWxhcPWB2u.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*boWmkkl6qSlv0ik7ZbnDZg.png" /></figure><p>Voila, I just found a similar shape 🥳, Now color the yellow to black and you are done.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*xM9FgO6Kw_LBMn9qp8e9eQ.png" /></figure><p>Now come to the Coding part. The problem I came across is how to mask off the middle section to show the background. I searched things around but couldn’t find a solution. So, I change the design a bit.</p><p>I applied a background layer and apply the same color to the middle section part and it looked like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*MTpsN7LIiiKvyLif96P_sw.png" /></figure><p>And not to be mentioned, it looked quite good 😝<em> just to change colors.</em></p><p>It was quite challenging to arrange the View like that, but after spending hours I finally coded it right.</p><h3>Animations</h3><p>Now comes the hard part, the animation. But that is what I love the most. The key solution to this problem is to simply move the entire shape right left to the icons and change the animation of the icons.</p><p>When the icon is pressed the layer will slide to the right or left to that position. That can be solved we divide the screen width with the number of icons we have. Since I have 5 icons I will be dividing the screen with 5.</p><p>We need something simple to control the sliding animation we simply want to move the layer with the values from 1 to 5. 1 means move the layer to 1st icon… similar to 2,3,4,5.</p><p>But how you move the layer with the number 1 to 5. Here’s what interpolate works. React native has this cool inbuilt feature to interpolate one set of values to another. Means we can map 1 to 5 with the sliding width of the layer.</p><p>After sliding the layer we will animate the icons to new values with the simple <a href="https://reactnative.dev/docs/animated">Animated</a> library.</p><p>And finally, it will look something like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/0*K_Ugkt_cs77E-Cbn.gif" /></figure><p>Linking with pages using call back function and it will look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*2uTMWPJu3-0YPfkwpB5cSQ.gif" /></figure><p>If you want to check out the code behind it, You can explore it on <a href="https://github.com/prashant9912/ReactNative_Curved_Navigation_Bar">Github</a>.</p><p>Also, if you want to use it in your real application you can install via using npm <a href="https://www.npmjs.com/package/rn-curved-navigation-bar">https://www.npmjs.com/package/rn-curved-navigation-bar</a></p><blockquote>npm i rn-curved-navigation-bar</blockquote><p>Or</p><blockquote>yarn add rn-curved-navigation-bar</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b60832cb2375" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Add Beautiful Lottie SplashSceen to Ionic App]]></title>
            <link>https://medium.com/@prashantg9912/how-to-add-beautiful-lottie-splashsceen-to-ionic-app-7fdbc00f6cea?source=rss-2db2e0b884ee------2</link>
            <guid isPermaLink="false">https://medium.com/p/7fdbc00f6cea</guid>
            <category><![CDATA[lottie]]></category>
            <category><![CDATA[animation]]></category>
            <category><![CDATA[ionic]]></category>
            <category><![CDATA[lottie-animation]]></category>
            <category><![CDATA[splash-screen]]></category>
            <dc:creator><![CDATA[Prashant Gupta]]></dc:creator>
            <pubDate>Sat, 14 Sep 2019 23:01:01 GMT</pubDate>
            <atom:updated>2019-09-15T13:30:49.441Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Add Beautiful Lottie Splash Sceen to Ionic App</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/286/1*oka843A6aTKYz_ipa3iI1Q.gif" /></figure><p>Lottie Library is one of the beautiful animation library made my engineers at Airbnb. Lottie Animations render as fast and support cross-platform.</p><p>You can create new animation using adobe after effects and render them to your app or web using Lottie, or you can use thousands of existing animations available on <a href="https://lottiefiles.com/">https://lottiefiles.com</a></p><p>So, one random day I found this library while working on one of the ionic app, and i thought of using it and the result was amazing. The app looks so good with the fast loading animation. <em>Sidenote: I was using gif before :P</em></p><p>Later, I thought why not use it as the splash screen instead of the boring static splash screen. So, I googled and say the doc mentioned on the <a href="https://ionicframework.com/docs/native/lottie-splash-screen">ionic website</a>. But the doc is incomplete and I got into a lot of troubles and error. After spending my hard time debugging and reading the actual <a href="https://github.com/timbru31/cordova-plugin-lottie-splashscreen">Github doc</a>, I finally get it working.</p><p>You can always clone the project from github@ <a href="https://github.com/prashant9912/Lottie-Ionic-SplashSceen">https://github.com/prashant9912/Lottie-Ionic-SplashSceen</a></p><p><strong>Install the packages</strong></p><p>run</p><blockquote><em>ionic cordova plugin add cordova-plugin-lottie-splashscreen</em></blockquote><blockquote>npm install @ionic-native/lottie-splash-screen</blockquote><p>After running these 2 lines in the ionic home directory you need to run</p><blockquote>npm install <a href="http://twitter.com/ionic">@ionic</a>-native/lottie-splash-screen</blockquote><blockquote>ionic cordova plugin add cordova-plugin-androidx-adapter</blockquote><p>This will make sure that you won’t get <strong><em>android.support.v4.os.ResultReceiver </em></strong>error while building.</p><p>For iOS user, you need to run</p><blockquote>sudo gem install cocoapods<br>pod setup</blockquote><p>Now add to /src/app/app.module.ts</p><blockquote>import { LottieSplashScreen } from &#39;@ionic-native/lottie-splash-screen/ngx&#39;;</blockquote><p>and providers too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TEbASFoDa7R7SIIbjoVVNA.png" /></figure><p>Next, we need to download our favorite animation from <a href="http://lottiefiles.com/">lottiefiles.com</a>, inside your<strong><em> </em>src/assets</strong> folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/1*RgUizQCwGn0q4svPShW1og.png" /></figure><p>Now open <strong>config.xml </strong>file and edit the file</p><p><strong>&lt;preference name=”SplashScreen” value=”screen” /&gt; </strong>to<strong> &lt;preference name=”SplashScreen” value=”none” /&gt;</strong></p><p>Now to display the lottie splash screen add</p><blockquote>&lt;preference name=”LottieAnimationLocation” value=”www/assets/loading.json” /&gt;</blockquote><blockquote>&lt;preference name=”LottieFullScreen” value=”true” /&gt;</blockquote><blockquote>&lt;preference name=”LottieLoopAnimation” value=”true” /&gt;</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/296/1*Ezgzm10zJ1I1L9NkII3dmg.gif" /></figure><p>Now we need to hide the splash screen as soon the app loads. so, we need to add <strong>this.lottieSplashScreen.hide()</strong> to <strong>app.component.ts</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SpfNGGTRK8MD9fTNuwbfFw.png" /></figure><p>I’ve added setTimeout function with 4sec delay just to enjoy the beautifully animated splash screen.</p><p>And here is the end product</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/296/1*waM-hhyWUse1p8wlETGG3g.gif" /></figure><p>You can clone the project from github @ <a href="https://github.com/prashant9912/Lottie-Ionic-SplashSceen">https://github.com/prashant9912/Lottie-Ionic-SplashSceen</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7fdbc00f6cea" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>