<?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: Mariusz</title>
    <description>The latest articles on DEV Community by Mariusz (@maniekm).</description>
    <link>https://dev.to/maniekm</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%2F176138%2Fe2a2effa-5fa9-4622-89e2-bc7baa1dc785.jpg</url>
      <title>DEV Community: Mariusz</title>
      <link>https://dev.to/maniekm</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/maniekm"/>
    <language>en</language>
    <item>
      <title>Why is Gatsby JS Good for Google Rankings?</title>
      <dc:creator>Mariusz</dc:creator>
      <pubDate>Fri, 18 Sep 2020 12:34:10 +0000</pubDate>
      <link>https://dev.to/pagepro_agency/why-is-gatsby-js-good-for-google-rankings-2g6</link>
      <guid>https://dev.to/pagepro_agency/why-is-gatsby-js-good-for-google-rankings-2g6</guid>
      <description>&lt;p&gt;SEO, which stands for Search Engine Optimisation), doesn't seem to get old — it's just different every year. Google changes its Search Algorithm and Ranking System every once in a while, adding new ranking factors or modifying existing ones. And since 2018, the page speed is one of them.&lt;/p&gt;

&lt;p&gt;However, there are more: content relevancy, mobile-friendliness, user experience, on-page optimisation... There are more than 200 of them in total. It's mind-blowing, isn't it?&lt;/p&gt;

&lt;p&gt;However, you don't have to take them all into account — focus on the most important ones.&lt;/p&gt;

&lt;p&gt;And if you are wondering how to do that and create a website with the highest chances to rank high, consider Gatsby. &lt;/p&gt;

&lt;p&gt;Keep reading to check why!&lt;/p&gt;

&lt;h2&gt;&lt;strong&gt;What is SEO?&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;Search Engine Optimisation (SEO) is a set of practices aimed to make a particular website look better and better in the eyes of Google. In other words, SEO is about improving the quality and quantity of website's traffic coming through search engine results pages (SERPs).&lt;/p&gt;

&lt;p&gt;Search engine result page, on the other hand, is a page that displays mainly (but not only) results returned by a search engine like Google as a response to query search such as "online shopping" or "front-end development agency".&lt;/p&gt;

&lt;h2&gt;&lt;strong&gt;Why does SEO matter?&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;SEO helps companies bring valuable, organic traffic to their websites which is the first step towards getting new clients and increasing revenue. The better SEO-optimised the site is, the higher it's ranked in SERPs. And the higher the ranking is, the bigger the traffic.&lt;/p&gt;

&lt;p&gt;The main difference between organic traffic (brought by SEO) and paid traffic (brought by money) is that the first one is free, forever. However, great SEO has more benefits than just saving money:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It drives the quality traffic to your website&lt;/strong&gt; — instead of reaching out to people whether they want to or not (interruption marketing), SEO focuses on making it easy for them to find you when they want to (permission marketing).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Organic results get more clicks than paid ads&lt;/strong&gt; — it's hard to tell why that is, but it doesn't alter the statistics: &lt;a href="https://www.advancedwebranking.com/blog/google-organic-ctr/#ctr-study" rel="noreferrer noopener nofollow"&gt;over 70% of searches&lt;/a&gt; end in clicking an organic result on the first page.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SEO supports Public Relations efforts&lt;/strong&gt; — one of the main elements of SEO is link building, which is about earning links from industry-respected publications and other relevant websites. On the other hand, featuring in such publications and being mentioned by influencers is a primary point of PR strategy. This presents an excellent opportunity to get in front of new customers through, for example, guest posting.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It helps you to overtake the competition&lt;/strong&gt; — SEO is an essential part of most marketing strategies which means there is a huge chance that your competition is already fighting for better rankings. However, with well-prepared and well-executed SEO efforts, you can catch up with them or even surpass them.&lt;/p&gt;

&lt;h2&gt;&lt;strong&gt;Main SEO ranking factors&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;There is a legend circulating in the marketing world that there is a man who knows all SEO ranking factors used by Google. However, no one ever saw him.&lt;/p&gt;

&lt;p&gt;Luckily, you don't have to know them all – only the main ones. But since giving specific SEO advice is not our goal here, we will just scratch the surface to provide you with an overview.&lt;/p&gt;

&lt;h3&gt;&lt;strong&gt;Accessibility&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;All your efforts to rank high will be for nothing if your website is not visible to search engine crawlers. These are robots that are crawling through the Internet to index websites. If the specific site is not indexed correctly, it won't be displayed in search results.&lt;/p&gt;

&lt;p&gt;What you have to do is create robots.txt file and website's sitemap. It's a confirmation of your site's accessibility. However, you can go one step further by submitting your website to Google through Google Search Console.&lt;/p&gt;

&lt;h3&gt;&lt;strong&gt;Backlinks&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;This is one of the most crucial SEO ranking factors, if not the most crucial one. As a reminder, backlinks are links to one website inserted on another website. The more backlinks you earn, the better it is for your website's SEO.&lt;/p&gt;

&lt;p&gt;However, it's more complicated than it looks like. Every single backlink and its effect on SEO is influenced by other factors like relevancy or domain authority.&lt;/p&gt;

&lt;h3&gt;&lt;strong&gt;Mobile-friendliness&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;Mobile-friendliness (or responsiveness) is a ranking factor for both mobile and desktop searches. If your website fully adapts to a visitor's device — whether it's a small-screen mobile phone or big-screen TV — it means that it's mobile-friendly (or responsive). And this is very much welcomed by Google.&lt;/p&gt;

&lt;p&gt;You can check if your website is mobile-friendly with &lt;a href="https://search.google.com/test/mobile-friendly" rel="noreferrer noopener nofollow"&gt;Google's official tool&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;&lt;strong&gt;On-page optimisation&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;All efforts within the website that are intended to improve the website's position in search engine results are called on-page optimisation. Among them are: creating proper title and meta tags, using the right keywords, optimising images, writing original and valuable content.&lt;/p&gt;

&lt;h3&gt;&lt;strong&gt;Page speed (desktop and mobile)&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;Page speed has been a ranking factor for a decade now. And two years ago it started to affect not only desktop searches but also mobile searches. However, don't treat it like a challenge to beat competitors by trying to make your website load a few milliseconds faster. Instead, make it fast enough, so it won't affect the user experience negatively.&lt;/p&gt;

&lt;p&gt;One more thing: according to Google's research, one-third of visitors will leave your website if page load time goes from one to three seconds. If it takes longer, it's even worse.&lt;/p&gt;

&lt;h3&gt;&lt;strong&gt;User experience&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;Would you come back to a place where you have had a terrible experience? Doubtful. The same thing goes for websites — the first impression makes all the difference. If the user experience is awful, it's likely you won't revisit it.&lt;/p&gt;

&lt;p&gt;While it's not clear how exactly Google measures user's satisfaction from visiting a particular website, they gave some suggestions about what's essential from the UX perspective:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Content that's useful and easy to read&lt;/li&gt;
&lt;li&gt;Design that's responsive and responds to users' needs&lt;/li&gt;
&lt;li&gt;Well-organised site architecture&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;&lt;strong&gt;Dynamic site vs static site: which one is better for SEO?&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;There is one more thing to consider: what kind of website should you choose to raise your chances of ranking high in search engine results pages. First of all, there are two main website types — dynamic site and static site.&lt;/p&gt;

&lt;h3&gt;&lt;strong&gt;What is a dynamic site?&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;Dynamic sites allow users to interact with the content posted on a website. That content is being generated in real-time, which means it can be different for different users, depending on their location, device, time zone, or even network.&lt;/p&gt;

&lt;p&gt;A dynamic website can use client-side scripting (the browser executes code), server-side scripting (the server runs code) or a combination of both.&lt;/p&gt;

&lt;p&gt;A good example of such websites are those built using a Content Management System (CMS) like WordPress or Drupal. &lt;/p&gt;

&lt;h3&gt;&lt;strong&gt;What is a static site?&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;Static websites, on the contrary, offer the same content for every visitor, regardless of their browser's language or other preferences. For every page, there is a specific HTML file on the server that contains the content of this page. Such a website is pre-rendered and is not meant to be regularly updated because it requires some HTML knowledge to edit source files.&lt;/p&gt;

&lt;p&gt;A good example of such websites is simple business websites created using static site generators (SSG) like Gatsby.&lt;/p&gt;

&lt;h3&gt;&lt;strong&gt;Which one does Google prefer?&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;While both types serve different purposes and require different skills, let's take a look at dynamic sites and static sites from Google perspective.&lt;/p&gt;

&lt;h4&gt;&lt;strong&gt;Static sites are faster.&lt;/strong&gt;&lt;/h4&gt;

&lt;p&gt;Page load speed is one of the leading SEO ranking factors, which also affects user experience in either a good or bad way. Static sites are faster than dynamic sites because they are pre-rendered. Pre-rendering means that your website is generated as a set of static files in advance, not in real-time. &lt;/p&gt;

&lt;h4&gt;&lt;strong&gt;Static sites are easier to index.&lt;/strong&gt;&lt;/h4&gt;

&lt;p&gt;Static websites consist of HTML and CSS files which are extremely easy to read and index by Google crawlers. Another thing that helps with indexation is a simple sitemap which is recommended by all search engines, including Google.&lt;/p&gt;

&lt;h4&gt;
&lt;strong&gt;Static sites are easier to optimise&lt;/strong&gt;.&lt;/h4&gt;

&lt;p&gt;When you decide to choose a static site, you gain total control over SEO. You can customise any page of your website in any way you want. In a case of dynamic websites, you need to install a plugin or two to help you with SEO efforts.&lt;/p&gt;

&lt;h4&gt;
&lt;strong&gt;Static sites are less expensive to host and maintain&lt;/strong&gt;.&lt;/h4&gt;

&lt;p&gt;Since static sites consist of simple HTML files, they need much less space on the hosting server than dynamic sites. Also, such a website won't use much of the monthly transfer limit.&lt;/p&gt;

&lt;h2&gt;&lt;strong&gt;What is Gatsby?&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;If you are considering creating a static site, Gatsby may be your choice of tool to do so. It is a free and open-source framework created with React, helping developers to build blazingly fast sites and apps. Gatsby is also called static site generator (SSG).&lt;/p&gt;

&lt;h2&gt;&lt;strong&gt;Why is Gatsby good for SEO?&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;It's time for the most important part of this article. I haven't jumped straight to that from the beginning because I wanted to explain the context. So far, you found out:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;what is SEO&lt;/li&gt;
&lt;li&gt;what does it matter&lt;/li&gt;
&lt;li&gt;main SEO ranking factors&lt;/li&gt;
&lt;li&gt;which one is better for SEO: dynamic site or static site&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It helped you to understand the whole picture better, right?&lt;/p&gt;

&lt;p&gt;Now it's time to find out why Gatsby is good for SEO.&lt;/p&gt;

&lt;h3&gt;&lt;strong&gt;Accessibility&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;Web accessibility means that websites, tools and technologies should be designed to be accessible for everyone, especially for those with permanent or temporary disabilities. When it comes to Gatsby and its accessibility, WebAIM (Web Accessibility in Mind, non-profit organisation) recognised Gatsby as the most accessible web framework.&lt;/p&gt;

&lt;p&gt;Gatsby uses different practices to make its websites as much accessible as possible:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Accessible routing&lt;/strong&gt; — the main feature of every website is navigation, and accessible routing takes care of that. Thanks to it, you can, for example, use a keyboard to navigate through the website. Also, Gatsby manages page announcements on page change.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Building HTML pages by default&lt;/strong&gt; — since it's using Node.js environment to compile pages, you don't have to worry about progressive page enhancement. Progressive enhancement means that the core page content is loaded before anything else from the server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Linting using a plugin&lt;/strong&gt; — Gatsby uses an &lt;em&gt;eslint-plugin-jsx-a11y&lt;/em&gt; package that reduces the time needed to find accessibility errors. This plugin, among other things, encourages you to add alternative text to all images. &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;&lt;strong&gt;Page metadata&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;Gatsby gives you full control over the website's content and structure, and consequently, over the SEO of this website. You can add metadata like page titles, meta descriptions and alt text, which helps search engines to understand the content on your website and when to display your site in search results.&lt;/p&gt;

&lt;p&gt;To add metadata to your website, you can use react-helmet components. Remember to add Gatsby React Helmet plugin to support SSR (server-side rendering).&lt;/p&gt;

&lt;h3&gt;&lt;strong&gt;Performance and speed&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;Gatsby is all about performance and speed. It comes with built-in features like rendering to static files or progressive image loading which are responsible for making Gatsby website fast. According to 2018 Google's update, site speed became the new ranking factor, and faster websites will likely rank higher than the slower ones. &lt;/p&gt;

&lt;p&gt;However, you should still create content that's valuable and relevant to visitors, because the slower but more relevant site may rank higher than the faster ones.&lt;/p&gt;

&lt;h3&gt;&lt;strong&gt;Structured data&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;Structured data is what Google looks for on the web to understand the website's content. This is also its source of general information about the web and the world.&lt;/p&gt;

&lt;p&gt;The better Google understands the content, the more relevant search results are. In other words, if you use structured data on your website, it helps you to rank higher.&lt;/p&gt;

&lt;p&gt;In Gatsby, you can add structured data snippets with react-helmet in the JSON-LD (JavaScript Object Notation for Linked Data) format, which is embedded either in the page head or page body.&lt;/p&gt;

&lt;h3&gt;&lt;strong&gt;User experience&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;All the points made above ensure great user experience to visitors. And it's not just about the site speed — with Gatsby you can create fully customised websites that are accessible to everyone, easy to find and navigate, and visually attractive.&lt;/p&gt;

&lt;h2&gt;&lt;strong&gt;Examples of Websites built with Gatsby&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;Many well-known companies decided to build their websites using Gatsby — Airbnb, Bitcoin.com, Braun, Spotify, to name a few. However, there is no limitation on who can use Gatsby because startups and small companies also choose it.&lt;/p&gt;

&lt;p&gt;Check below examples to see how such websites look and perform:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://airbnb.io/" rel="noreferrer noopener nofollow"&gt;Airbnb Engineering &amp;amp; Data Science&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://bitcoin.com" rel="noreferrer noopener nofollow"&gt;Bitcoin.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ca.braun.com/en-ca" rel="noreferrer noopener nofollow"&gt;Braun&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://frame.io" rel="noreferrer noopener nofollow"&gt;Frame.io&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hopper.com" rel="noreferrer noopener nofollow"&gt;Hopper&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://spotify.design" rel="noreferrer noopener nofollow"&gt;Spotify.design&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://frontend-day.com" rel="noreferrer noopener"&gt;Frontend Day conference&lt;/a&gt; created by Pagepro&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://jsminds.com" rel="noreferrer noopener"&gt;JS Minds&lt;/a&gt; created by Pagepro&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Many well-known companies decided to build their websites with Gatsby — like Braun, Spotify and AirBnb, just to name a few.&lt;/p&gt;

&lt;h2&gt;&lt;strong&gt;Alternatives to Gatsby&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;We highly recommend Gatsby to build static sites, but we also would like to help you make a fully informed decision. Because of that, we wrote about Gatsby alternatives — you can read about them &lt;a href="https://pagepro.co/blog/is-gatsbyjs-the-best-framework-for-building-static-websites-what-are-the-other-alternatives/" rel="noreferrer noopener"&gt;here&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>gatsby</category>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Is React Native Good for Startups?</title>
      <dc:creator>Mariusz</dc:creator>
      <pubDate>Thu, 03 Sep 2020 13:37:45 +0000</pubDate>
      <link>https://dev.to/pagepro_agency/is-react-native-good-for-startups-23i9</link>
      <guid>https://dev.to/pagepro_agency/is-react-native-good-for-startups-23i9</guid>
      <description>&lt;p&gt;Building a startup is like driving a sports-car. It's fun, it's exciting, but it is also about fast yet wise decisions. Making mistakes is not an option, and the danger is high. You may either crash your car or run out of gas before getting to your planned destination.&lt;/p&gt;

&lt;p&gt;If you want to avoid this, choose your vehicle and engine that comes with it wisely. And reading this piece will help you to decide whether choosing React Native for startups is actually a good idea.&lt;/p&gt;

&lt;h2&gt;&lt;strong&gt;What is React Native?&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;React Native is an open-source, cross-platform framework created by Facebook in 2015 for building mobile applications using React. It's like an engine for your startup's app. It allows developers to accelerate the development of native apps for operating systems like Android and iOS.&lt;/p&gt;

&lt;p&gt;React, in turn, is a JavaScript library, which was created to build user interfaces.&lt;/p&gt;

&lt;p&gt;If you want to become more familiar with React Native, read our &lt;a href="https://pagepro.co/blog/what-is-react-native-a-definite-guide-to-the-top-mobile-framework/" rel="noreferrer noopener"&gt;comprehensive guide&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;&lt;strong&gt;Which startups use React Native?&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;React Native is a choice for many companies, from tech giants like Facebook itself to young startups looking for funding. If you are curious, here is the list of some popular applications that have been built using this trend-setting technology:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Discord&lt;/li&gt;
&lt;li&gt;Facebook&lt;/li&gt;
&lt;li&gt;Facebook Analytics&lt;/li&gt;
&lt;li&gt;Instagram&lt;/li&gt;
&lt;li&gt;Pinterest&lt;/li&gt;
&lt;li&gt;Skype&lt;/li&gt;
&lt;li&gt;Salesforce&lt;/li&gt;
&lt;li&gt;Uber Eats&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KjDZ-ON3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh3.googleusercontent.com/DKO2TaEORMONff01zHzbQqpETwH6N15Zx6jpiyr-jSR3kZp6xbh5QBpQ_gOeWyCQYGZRuua3f_uEVTattmRyQ_Y8V1XtNC8g4OhRjP6TrJprr5vScR95j6FaJXN6LyMakex97R-g" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KjDZ-ON3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh3.googleusercontent.com/DKO2TaEORMONff01zHzbQqpETwH6N15Zx6jpiyr-jSR3kZp6xbh5QBpQ_gOeWyCQYGZRuua3f_uEVTattmRyQ_Y8V1XtNC8g4OhRjP6TrJprr5vScR95j6FaJXN6LyMakex97R-g" alt="Popular brands using React Native"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are more examples, but it all comes down to this: if they rely on React Native, why shouldn't the others?&lt;/p&gt;

&lt;p&gt;And that’s just the way startups that use React Native like &lt;a href="https://mattermost.com/" rel="noreferrer noopener nofollow"&gt;Mattermost&lt;/a&gt; (self-hosted open-source Slack alternative) or &lt;a href="https://www.ovalmoney.com/" rel="noreferrer noopener nofollow"&gt;Oval&lt;/a&gt; (creators of personal finance app) think.&lt;/p&gt;

&lt;h2&gt;&lt;strong&gt;When to consider choosing React Native?&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;Choosing the proper technology for your mobile application is challenging. But it may become a bit easier after reflecting on needs, estimated budget and available time. Therefore, there are some scenarios in which React Native might be the right choice. Consider choosing React Native:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;If you have native apps&lt;/strong&gt; &lt;strong&gt;already&lt;/strong&gt;— if you already have iOS and/or Android applications, you can change to React Native, because it doesn't require re-writing the entire code which makes migration a lot easier (check &lt;a href="https://blog.khanacademy.org/our-transition-to-react-native/"&gt;here&lt;/a&gt; how Khan Academy managed such a transition)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;To scale quickly&lt;/strong&gt; — it's easy to hire or train React Native developers so growing a team fast is not a problem.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;To create MVP fast&lt;/strong&gt; — having just an idea is not enough, and you must test it in real market conditions. In other words, you need to create an MVP as fast as possible.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;If you have tight deadlines&lt;/strong&gt; — if you work in a startup, you need to move fast. Need-for-Speed-like fast or even faster. And it's not about creating MVP. It's also about making constant changes and updates with as little effort and time as it's needed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;If your budget is strictly limited&lt;/strong&gt; — having just an idea is not enough for most investors. A minimum you need is working MVP, but there is a chance that you won't finish it before running out of money. Using React Native will help you minimise that risk.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
&lt;strong&gt;Benefits of using React Native&lt;/strong&gt; for Startups&lt;/h2&gt;

&lt;p&gt;Looking closely at benefits is always a good idea when it comes to making more or less important decisions. To help you make a great one regarding technology for your startup, we prepared a list of benefits from both business and technical perspectives.&lt;/p&gt;

&lt;h3&gt;&lt;strong&gt;Benefits from a business perspective&lt;/strong&gt;&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Excellent User Experience&lt;/strong&gt; — User Experience of any digital product is essential to its success. While technically a React Native app is not "the app", it looks and feels like it. Especially because it's fully responsive.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stability and evolvement&lt;/strong&gt; — since its foundation, React Native matured, is still evolving and backed up by a huge community. Most common problems are already solved. Therefore, the risk of using it doesn't exist.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Developers availability&lt;/strong&gt; — React Native is not a new technology or one that nobody knows. The reverse is true: the developer marketplace is robust. You can either hire freelancers using websites like Upwork or &lt;a href="https://pagepro.co/contact.html" rel="noreferrer noopener"&gt;talk to an agency like ours&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shortened time to market (TTM)&lt;/strong&gt; — the sky is the limit, and time is the money. As a startup, you don't want to create an app for months without showing it to real users and future customers. React Native boosts up mobile development up to 50% in comparison to native app development so startups can create working MVP even twice as fast.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Money savings&lt;/strong&gt; — this point is highly connected with the previous points. Still, there is more: a decision to build a single cross-platform app is far better economical choice than creating two separate applications for iOS and Android.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Time savings&lt;/strong&gt; — using React Native means that you don't have to create two separate applications for two separate platforms. Not to mention the time you will spend on upgrading and fixing them.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;&lt;strong&gt;Benefits from a technical perspective&lt;/strong&gt;&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Compatibility with back-end technologies&lt;/strong&gt; — you can use React Native with back-end frameworks like Django or Ruby on Rails, and it will work like a charm&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Declarative style&lt;/strong&gt; — it's about &lt;strong&gt;WHAT &lt;/strong&gt;you want to do, in a contrary to imperative style, which is about &lt;strong&gt;HOW&lt;/strong&gt; you want to do it. For example, let's say that you hired a private chef and want to eat a fancy dinner at home. Instead of telling him &lt;strong&gt;HOW &lt;/strong&gt;to do it (imperative style), you just say &lt;strong&gt;WHAT &lt;/strong&gt;you want (declarative style), i.e. "Make me Hawaii pizza, please."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dynamic development&lt;/strong&gt; — since its creation in 2015, React Native evolved both as a technology and community, and it doesn't seem it will rest on its's laurels. Because of that, you can be sure of two things: (1) it's more future-proof than some other technologies and (2) the chances of finding someone to hire or to help you are very high.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hot Reloading&lt;/strong&gt; — in short, it allows you for making changes to your app code while it's still up and running. It accelerates app developments significantly because your app can reload automatically.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open-source community&lt;/strong&gt; — if you are stuck somewhere along the development process, you can always go to GitHub or Reddit to ask for help, and there is a great chance that someone will help you out&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reusable components&lt;/strong&gt; — why write the same code again and again, when you can re-use already-built elements? It works across both iOS and Android, and it's enough to update a particular component in one view. It's possible because updates will be automatically made in each case of using this component&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Third-party extensions support&lt;/strong&gt; — React Native is all about speeding up the development process. Apart from RN itself, you can use many third-party plugins and frameworks like &lt;a href="https://nativebase.io/"&gt;NativeBase&lt;/a&gt; (which helps you to create native-like apps) or &lt;a href="https://galio.io/"&gt;Galio&lt;/a&gt; (which is a library of UI components)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;&lt;strong&gt;Disadvantages of using React Native&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;Unfortunately, it's not all rainbows and butterflies. Like any other technology, React Native also has its flaws: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Complicated updating process&lt;/strong&gt; — keeping your cross-platform application always up with the latest React Native version is a challenge. It's a complicated process that's much easier in the case of native apps.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Issues with more complicated design&lt;/strong&gt; — React Native may not be the best choice if you want to use gain business leverage by using some advanced interactions or custom graphics&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lack of custom modules&lt;/strong&gt; — sometimes, you will have to build specific components from scratch.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Messy code after migration&lt;/strong&gt; — you may have to rewrite some code to make necessary adjustments or to make APIs work correctly again.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;&lt;strong&gt;When to choose a native app instead of React Native?&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;It’s not like that cross-platform app is always a better choice than going with a native app. There are some scenarios in which it's better to choose the latter option. Consider native app if:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Performance is what you care most about&lt;/li&gt;
&lt;li&gt;Security is your priority, i.e. if you are in the FinTech industry.&lt;/li&gt;
&lt;li&gt;Your app will be heavy on graphics. In other words, if you want to include advanced interactions, custom animations, or various screen transitions in your app.&lt;/li&gt;
&lt;li&gt;Your app will require a lot of interactions with hardware like GPS, i.e. if it uses geolocation tracking.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;&lt;strong&gt;Alternatives to React Native&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vS2G80jb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh3.googleusercontent.com/lt4YdSlG-keIQ6taiikaTP1aZZ-dub9E_cqEqosvLBikPNhdIemFnnU0wWgXNurw9DRCLwnRlVqE1Xk8vOjQvo53fjKCCYXYK5iV91uTOUn8T8k9HU8kD6GmgtnargaTC7fi6m5W" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vS2G80jb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh3.googleusercontent.com/lt4YdSlG-keIQ6taiikaTP1aZZ-dub9E_cqEqosvLBikPNhdIemFnnU0wWgXNurw9DRCLwnRlVqE1Xk8vOjQvo53fjKCCYXYK5iV91uTOUn8T8k9HU8kD6GmgtnargaTC7fi6m5W" alt="React Native alternatives"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Flutter&lt;/strong&gt; — it's a framework created by Google to build mobile, web, and desktop applications using a single codebase. To find out more, read our &lt;a href="https://pagepro.co/blog/react-native-vs-flutter-which-is-better-for-cross-platform-app/" rel="noreferrer noopener"&gt;comparison between these two&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Xamarin &lt;/strong&gt;— it’s a framework created by Microsoft, which allows developers to build iOS and Android applications. But in a contrary to React Native, Xamarin apps are written in C#.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ionic &lt;/strong&gt;— thanks to it, developers can use standard web technologies like Javascript, HTML and CSS to build cross-platform mobile applications. The difference between React Native and Ionic is that Ionic is hybrid, and the RN is native.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All of the above alternatives are cross-platform and open-source solutions.&lt;/p&gt;

&lt;h2&gt;React Native &lt;strong&gt;FAQ&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;&lt;strong&gt;How long does it take to build a React Native application?&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;The reply is: it depends (it’s our favourite answer). While choosing React Native to build an application speeds up the development process up to 50% in comparison to native app development, the time needed depends on the complexity of the desired application.&lt;/p&gt;

&lt;p&gt;Such an estimation can be prepared after outlining the software complexity by both sides.&lt;/p&gt;

&lt;h3&gt;&lt;strong&gt;How much does it cost?&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;Again, it depends. Development agency can give you a ballpark estimate of your project, including time and money needed, after outlining its complexity.&lt;/p&gt;

&lt;h2&gt;What's next?&lt;/h2&gt;

&lt;p&gt;If you are more like a reader, you can check our &lt;a href="https://pagepro.co/blog/what-is-react-native-a-definite-guide-to-the-top-mobile-framework/" rel="noreferrer noopener"&gt;comprehensive guide on React Native&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>react</category>
      <category>reactnative</category>
      <category>webdev</category>
      <category>startup</category>
    </item>
    <item>
      <title>Using Next.js as a Static Site Generator</title>
      <dc:creator>Mariusz</dc:creator>
      <pubDate>Fri, 21 Aug 2020 09:55:10 +0000</pubDate>
      <link>https://dev.to/pagepro_agency/using-next-js-as-a-static-site-generator-3bo1</link>
      <guid>https://dev.to/pagepro_agency/using-next-js-as-a-static-site-generator-3bo1</guid>
      <description>&lt;p&gt;Static Site Generators are becoming extremely popular in the world of &lt;a rel="noreferrer noopener" href="https://pagepro.co/web-app-development.html"&gt;web development&lt;/a&gt; and Next.js is a proud competitor in this race. &lt;/p&gt;

&lt;h2&gt;&lt;b&gt;What are Static Site Generators?&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;🚀 STATIC = BLAZINGLY FAST 🚀&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Static Site Generator are extremely fast. Once loaded, they prefetches resources for other pages so clicking around the site feels like a blonk of an eye.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;💎 STATIC = SAFE 💎&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You will just publish static files, which means there is no direct connection to the database, dependencies, user data or other sensitive information.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;😎 STATIC = ENHANCED USER EXPERIENCE 😎&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Simply because clicking and walking through your website feels like a walk in a park on a sunny day with no unexpected turns, stairs, or dead ends. &lt;/p&gt;

&lt;h2&gt;&lt;b&gt;What is Next.js?&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;“Next is a framework which we can use to build React sites with Server Side Rendering or generate static pages from our react code. All that configured for us by Next itself.”&lt;/p&gt;

&lt;p&gt;And in this post we will be taking a look at the static pages export functionality and how we can make it with next.js.&lt;/p&gt;

&lt;p&gt;Let's go! &lt;/p&gt;

&lt;h2&gt;&lt;b&gt;Creating an app&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;We will start by creating a new next app. To do that simply run the command:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="n"&gt;yarn&lt;/span&gt; &lt;span class="n"&gt;create&lt;/span&gt; &lt;span class="n"&gt;next&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;
&lt;span class="c1"&gt;# or if you are using npm&lt;/span&gt;
&lt;span class="n"&gt;npx&lt;/span&gt; &lt;span class="n"&gt;create&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;next&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, let’s take a look at our project structure:&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%2Fpagepro.co%2Fblog%2Fwp-content%2Fuploads%2F2020%2F07%2Fstructre.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%2Fpagepro.co%2Fblog%2Fwp-content%2Fuploads%2F2020%2F07%2Fstructre.png" alt="next app structure"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;em&gt;pages&lt;/em&gt;&lt;/b&gt; - this directory contains all our pages and defines routing for our app (&lt;a rel="noreferrer noopener nofollow" href="https://nextjs.org/docs/routing/introduction"&gt;more about routing here&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;em&gt;pages/api&lt;/em&gt;&lt;/b&gt; - here we can add our API endpoint if we need some, in our case we can remove this folder safely (&lt;a rel="noreferrer noopener nofollow" href="https://nextjs.org/docs/api-routes/introduction"&gt;more about API routes here&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;em&gt;public&lt;/em&gt;&lt;/b&gt; - we can put all our static assets in this directory.&lt;/p&gt;

&lt;p&gt;Let’s change our commands to reflect what we want to achieve in this project. Got to package.json and modify scripts section like this:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;dev&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;next dev&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="nx"&gt;remove&lt;/span&gt;
&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;build&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;next build&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;build&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;next build &amp;amp;&amp;amp; next export&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;start&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;next start&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;start&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;next dev&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So now our scripts section should look like this:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;scripts&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;build&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;next build &amp;amp;&amp;amp; next export&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;start&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;next dev&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we can test our configuration, run the build command:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="n"&gt;yarn&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt; &lt;span class="n"&gt;build&lt;/span&gt;
&lt;span class="c1"&gt;# or if you are using npm&lt;/span&gt;
&lt;span class="n"&gt;npm&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt; &lt;span class="n"&gt;build&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next should create &lt;strong&gt;out&lt;/strong&gt; directory at the root of our project with all the static html files and assets ready to host. We can change the &lt;strong&gt;out&lt;/strong&gt; directory by adding a &lt;strong&gt;-o &lt;/strong&gt;flag to our &lt;strong&gt;next export&lt;/strong&gt; command like this:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;scripts&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;build&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;next build &amp;amp;&amp;amp; next export -o build&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;...&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;&lt;b&gt;Adding content to page&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;Let’s head to &lt;strong&gt;pages\index.js&lt;/strong&gt; file and remove the content of &lt;strong&gt;Home&lt;/strong&gt; component and change it like this:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Home&lt;/span&gt; &lt;span class="o"&gt;=&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;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nx"&gt;Hello&lt;/span&gt; &lt;span class="nx"&gt;From&lt;/span&gt; &lt;span class="nx"&gt;my&lt;/span&gt; &lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;Home&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And start our app by running command:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="n"&gt;yarn&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt; &lt;span class="n"&gt;build&lt;/span&gt;
&lt;span class="c1"&gt;# or if you are using npm&lt;/span&gt;
&lt;span class="n"&gt;npm&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt; &lt;span class="n"&gt;build&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you should be able to access http://localhost:3000 and see our Home component content.&lt;/p&gt;

&lt;p&gt;Now let’s add some content that will be evaluated at the build time. We can do that by using &lt;strong&gt;getStaticProps&lt;/strong&gt; which is a function exported from our page. As we don’t have any data source configured yet we will do a simple example to show how &lt;strong&gt;getStaticProps&lt;/strong&gt; work.&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Home&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;buildTimestamp&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;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nx"&gt;Hello&lt;/span&gt; &lt;span class="nx"&gt;From&lt;/span&gt; &lt;span class="nx"&gt;my&lt;/span&gt; &lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;
      &lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="nx"&gt;built&lt;/span&gt; &lt;span class="na"&gt;at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;buildTimestamp&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;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getStaticProps&lt;/span&gt; &lt;span class="o"&gt;=&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;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;props&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;buildTimestamp&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;Home&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We will see that &lt;strong&gt;buildTimestamp&lt;/strong&gt; changes every refresh, this will not be the case when we build our app because &lt;strong&gt;getStaticProps&lt;/strong&gt; is called only once when app is building.&lt;/p&gt;

&lt;h2&gt;&lt;b&gt;Adding data source&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;We already know how &lt;strong&gt;getStaticProps&lt;/strong&gt; works, now we can make it more useful and add some external data source to our app. Next.js doesn’t come with any data provider built in (for example GatsbyJS has graphql) so we will have to add it manually. &lt;/p&gt;

&lt;p&gt;Basically you can load your data however you like. In this tutorial we will use GraphQL with Apollo Client. First let’s add src directory where we will keep all our code shared between pages. Then create &lt;strong&gt;src\setup\apolloClient.js&lt;/strong&gt; file where our apollo client will be created.&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ApolloClient&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;apollo-client&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;HttpLink&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;apollo-link-http&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;InMemoryCache&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;apollo-cache-inmemory&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;apolloClient&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ApolloClient&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;link&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;HttpLink&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;uri&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://gitlab.com/api/graphql&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}),&lt;/span&gt;
  &lt;span class="na"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;InMemoryCache&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;apolloClient&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Additionally we will have to install some apollo realated packages. Simply run the command:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="n"&gt;yarn&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt; &lt;span class="n"&gt;add&lt;/span&gt; &lt;span class="n"&gt;apollo&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;cache&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;inmemory&lt;/span&gt; &lt;span class="n"&gt;apollo&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="n"&gt;apollo&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;link&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt; &lt;span class="n"&gt;graphql&lt;/span&gt; &lt;span class="n"&gt;graphql&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;tag&lt;/span&gt;
&lt;span class="c1"&gt;# or if you are using npm&lt;/span&gt;
&lt;span class="n"&gt;npm&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;save&lt;/span&gt; &lt;span class="n"&gt;apollo&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;cache&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;inmemory&lt;/span&gt; &lt;span class="n"&gt;apollo&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="n"&gt;apollo&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;link&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt; &lt;span class="n"&gt;graphql&lt;/span&gt; &lt;span class="n"&gt;graphql&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;tag&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see we will be using GitLab graphql api (&lt;a rel="noreferrer noopener nofollow" href="https://gitlab.com/-/graphql-explorer"&gt;explorer is available here&lt;/a&gt;).&lt;/p&gt;

&lt;h2&gt;&lt;b&gt;Creating pages and fetching data&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;Now we can fetch some data, let’s fetch some repositories. First we have to create graphql query:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;PROJECTS_QUERY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;gql&lt;/span&gt;&lt;span class="s2"&gt;`
  query {
    projects (first: 10) {
      nodes {
        id
        name
        description
      }
    }
  }
`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we can import apollo client and use it with above query in our &lt;strong&gt;getStaticProps&lt;/strong&gt;:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getStaticProps&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &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="kd"&gt;const&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;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;apolloClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;query&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;PROJECTS_QUERY&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;props&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;projects&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;projects&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now list of GitLab projects is available in our &lt;strong&gt;Home&lt;/strong&gt; component props, let’s render it.&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Home&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;projects&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;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ul&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;projects&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;nodes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(({&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;description&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;id&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;strong&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;name&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;/strong&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nx"&gt;p&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;description&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;span&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;description&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;/span&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;}
&lt;/span&gt;        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/li&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;/ul&amp;gt;&lt;/span&gt;&lt;span class="err"&gt; 
&lt;/span&gt;  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And that’s it, we have a working GitLab projects list. &lt;/p&gt;

&lt;p&gt;Now let’s add project detail page. &lt;/p&gt;

&lt;p&gt;First we have to add dynamic route to our app, we can do that by creating a file with square brackets in its name, like this:&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%2Fpagepro.co%2Fblog%2Fwp-content%2Fuploads%2F2020%2F07%2Fsquare.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%2Fpagepro.co%2Fblog%2Fwp-content%2Fuploads%2F2020%2F07%2Fsquare.png" alt="a square presenting how to save a project with square brackets"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a rel="noreferrer noopener nofollow" href="https://nextjs.org/docs/routing/dynamic-routes"&gt;More about dynamic routing here.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When we are building our pages statically Next.js requires us to export a function called &lt;strong&gt;getStaticPaths&lt;/strong&gt; from our page. &lt;/p&gt;

&lt;p&gt;We have to do that because Next.js needs to know all the page urls and their params at the build time. We have fetched first 10 Gitlab projects at our homepage so now we have to do the same in our &lt;strong&gt;getStaticPaths&lt;/strong&gt; to generate urls.&lt;/p&gt;

&lt;p&gt;First let’s add links to projects details on homepage. We have to add fullPath field to our query:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;PROJECTS_QUERY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;gql&lt;/span&gt;&lt;span class="s2"&gt;`
  query {
    projects (first: 10) {
      nodes {
        id
        name
        description
        fullPath
      }
    }
  }
`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And render next link for every project:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Home&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;projects&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;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ul&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;projects&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;nodes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(({&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;description&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;fullPath&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;strong&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;name&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;/strong&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nx"&gt;p&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;description&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;span&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;description&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;/span&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;}
&lt;/span&gt;          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Link&lt;/span&gt;
              &lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/project/[...fullPath]&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
              &lt;span class="k"&gt;as&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;`/project/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;fullPath&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
              &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Details&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/a&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Link&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/li&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;/ul&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we can add code to our project details page:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;gql&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;graphql-tag&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;apolloClient&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../../src/setup/apolloClient&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ProjectDetailsPage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;fullPath&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;return&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Project&lt;/span&gt; &lt;span class="nx"&gt;details&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;fullPath&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;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;ProjectDetailsPage&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;PROJECTS_QUERY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;gql&lt;/span&gt;&lt;span class="s2"&gt;`
  query {
    projects(first: 10) {
      nodes {
        fullPath
      }
    }
  }
`&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getStaticPaths&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &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="kd"&gt;const&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;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;apolloClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;query&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;PROJECTS_QUERY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;paths&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;projects&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;nodes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(({&lt;/span&gt; &lt;span class="nx"&gt;fullPath&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="c1"&gt;// 1&lt;/span&gt;
      &lt;span class="na"&gt;params&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;fullPath&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;fullPath&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;})),&lt;/span&gt;
    &lt;span class="na"&gt;fallback&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// 2&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getStaticProps&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;params&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;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;props&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;fullPath&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;fullPath&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// 3&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let’s explain some key parts here:&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;We map our projects list to an array of paths required by Next.js. Structure that Nexts.js expects looks like this:&lt;/li&gt;&lt;/ol&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;paths&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="na"&gt;params&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
         &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;all&lt;/span&gt; &lt;span class="nx"&gt;params&lt;/span&gt; &lt;span class="nx"&gt;that&lt;/span&gt; &lt;span class="nx"&gt;we&lt;/span&gt; &lt;span class="nx"&gt;want&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="nx"&gt;pass&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="nx"&gt;getStaticProps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
       &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Also when we use Catch All route we have to pass our param as array that’s why we use split here.&lt;/p&gt;

&lt;ol start="2"&gt;
&lt;li&gt;We have to tell next if we want to render missing pages live or just return 404. In our case we are making fully static page so we define fallback as false. &lt;a href="https://nextjs.org/docs/basic-features/data-fetching#the-fallback-key-required" rel="noreferrer noopener nofollow"&gt;More about fallback here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt; We merge our fullPath param to single string so we can display it nicely in our component.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now we can change &lt;strong&gt;getStaticProps&lt;/strong&gt; to be more useful and fetch some project data for us. First we need query for project details:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;PROJECT_DETAILS_QUERY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;gql&lt;/span&gt;&lt;span class="s2"&gt;`
  query ($fullPath: ID!) {
    project(fullPath: $fullPath) {
      name
      descriptionHtml
      repository {
        empty
        tree {
          lastCommit {
            sha
          }
        }
      }
    }
  }
`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And run it inside of our &lt;strong&gt;getStaticProps&lt;/strong&gt;&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getStaticProps&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;params&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fullPath&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;fullPath&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&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;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;apolloClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;query&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;PROJECT_DETAILS_QUERY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;variables&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;fullPath&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;props&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;project&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;project&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we can display some data on our project details page:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ProjectDetailsPage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;project&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="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;descriptionHtml&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;repository&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;tree&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;project&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;lastCommit&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;tree&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;sha&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;lastCommit&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&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;name&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;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt; &lt;span class="nx"&gt;dangerouslySetInnerHTML&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt; &lt;span class="na"&gt;__html&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;descriptionHtml&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="nx"&gt;sha&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Last&lt;/span&gt; &lt;span class="nx"&gt;commit&lt;/span&gt; &lt;span class="na"&gt;SHA&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;sha&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;/p&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;}
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And that’s it, we have created a static page displaying first 10 GitLab projects and their details. &lt;/p&gt;

&lt;p&gt;We can now build it and serve to check if everything is working properly.&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="n"&gt;yarn&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt; &lt;span class="n"&gt;build&lt;/span&gt;
&lt;span class="c1"&gt;# or if you are using npm&lt;/span&gt;
&lt;span class="n"&gt;npm&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt; &lt;span class="n"&gt;build&lt;/span&gt;

&lt;span class="c1"&gt;# if you are using yarn and don't have serve installed run this command first&lt;/span&gt;
&lt;span class="n"&gt;yarn&lt;/span&gt; &lt;span class="k"&gt;global&lt;/span&gt; &lt;span class="n"&gt;add&lt;/span&gt; &lt;span class="n"&gt;serve&lt;/span&gt;


&lt;span class="c1"&gt;# if you are using yarn&lt;/span&gt;
&lt;span class="n"&gt;serve&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;build&lt;/span&gt;
&lt;span class="c1"&gt;# or if you are using npm&lt;/span&gt;
&lt;span class="n"&gt;npx&lt;/span&gt; &lt;span class="n"&gt;serve&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;build&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a rel="noreferrer noopener" href="https://github.com/Pagepro/nextjs-static-site-generator"&gt;Access the full project here. &lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;&lt;b&gt;Next.js vs GatsbyJS&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;As we can see &lt;strong&gt;Next.js&lt;/strong&gt; can successfully generate static pages like &lt;strong&gt;GatsbyJS&lt;/strong&gt; does and someone could ask:&lt;/p&gt;

&lt;p&gt;“Can Next.js replace GatsbyJS?”&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%2Fpagepro.co%2Fblog%2Fwp-content%2Fuploads%2F2020%2F07%2Fyes-and-no.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%2Fpagepro.co%2Fblog%2Fwp-content%2Fuploads%2F2020%2F07%2Fyes-and-no.png" alt="a cartoon pirate is saying you cannot actually replace GatsbyJS with Next.JS"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can do all the things in Next.js that you do in GatsbyJS but it take much more time because you need to do everything by yourself. &lt;/p&gt;

&lt;p&gt;GatsbyJS has a lot of plugins that help to solve many problems and optimize the page. More than that it has data fetching features built in (graphql available out of the box). So for now we will have to wait for Next.js ecosystem to grow and get more plugins so we can create static pages as fast as we do in GatsbyJS.&lt;/p&gt;

&lt;p&gt;Keep in mind that &lt;strong&gt;Next.js has one big advantage over GatsbyJS&lt;/strong&gt;: &lt;/p&gt;

&lt;ul&gt;&lt;li&gt;you can create and app which is partially static and dynamic. &lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;For example you can prerender first 10 posts from your blog and the rest can be rendered when the page is requested by user.&lt;/p&gt;

&lt;p&gt;So for now Next.js is just a more flexible solution that requires more work and gives us some powerful extra features but in terms of development time GatsbyJS is still better.&lt;/p&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>React Native Code Review - A Checklist
</title>
      <dc:creator>Mariusz</dc:creator>
      <pubDate>Tue, 04 Aug 2020 13:34:47 +0000</pubDate>
      <link>https://dev.to/pagepro_agency/checklist-for-a-successful-react-native-code-review-4742</link>
      <guid>https://dev.to/pagepro_agency/checklist-for-a-successful-react-native-code-review-4742</guid>
      <description>&lt;p&gt;Did you ever want to do a code review of &lt;a href="https://pagepro.co/react-native-development.html"&gt;React Native app&lt;/a&gt; by yourself? &lt;/p&gt;

&lt;p&gt;If yes, let me guide you through the whole process, step-by-step with our own checklist.&lt;/p&gt;

&lt;p&gt;But if you are quite new to the subject of code review, let's start from the basics.&lt;/p&gt;

&lt;h2&gt;&lt;b&gt;What is Code Review?&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;Code review is a form of deep and profound analysis of the existing codebase. It comes with a set of specific activities and checklist points that leads you step-by-step through the process of identifying and uncovering current and potential bugs and problems.&lt;/p&gt;

&lt;h2&gt;&lt;b&gt;When Should I Do a React Native Code Review?&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;Different &lt;a href="https://pagepro.co/" rel="noreferrer noopener"&gt;React Native Developers&lt;/a&gt; face different scenarios, but it doesn't matter if:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;you just took over an app from a different developer, or&lt;/li&gt;
&lt;li&gt;someone asked you to improve the existing app, or&lt;/li&gt;
&lt;li&gt;you just built an app and want to make sure it’s flawless…&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;…you need to have a deep understanding of what’s inside and where the potential source of errors may be hidden.&lt;/p&gt;

&lt;p&gt;And if you think about it, there may be many areas that code review will appear to be highly recommended, if not absolutely necessary. &lt;/p&gt;

&lt;h3&gt;&lt;b&gt;Improve Performance&lt;/b&gt;&lt;/h3&gt;

&lt;p&gt;First of all, code review is extremely important if it comes to app performance.&lt;/p&gt;

&lt;p&gt;While talking about React Native and the cross-platform applications in general, their performance and user-interface is considered sometimes as the biggest challenge.&lt;/p&gt;

&lt;p&gt;The goal is to make the final experience native-like. Which means performance has to be outstanding.&lt;/p&gt;

&lt;p&gt;And this is when the code review is a great idea, as it is able to uncover many flaws and areas of improvement.&lt;/p&gt;

&lt;h3&gt;&lt;b&gt;Scale Easier&lt;/b&gt;&lt;/h3&gt;

&lt;p&gt;Planning your future app improvement demands a deep understanding of its architecture.&lt;/p&gt;

&lt;p&gt;The analysis of a fundamental app functionalities will help you plan how actually you can improve it later on.&lt;/p&gt;

&lt;h3&gt;&lt;b&gt;After Changes and Improvements&lt;/b&gt;&lt;/h3&gt;

&lt;p&gt;As you know it’s almost impossible to build and release an app without few changes here and there. &lt;a href="https://reactnative.dev/" rel="noreferrer noopener nofollow"&gt;React Native&lt;/a&gt; apps are no different.&lt;/p&gt;

&lt;p&gt;Keeping a code review checklist on your sight makes it easier to keep your app in shape despite the changes you have made.&lt;/p&gt;

&lt;h3&gt;&lt;b&gt;React Native Bug Fixing&lt;/b&gt;&lt;/h3&gt;

&lt;p&gt;Even if you went through and passed many different tests, it doesn’t really mean your app is totally ready to hit the market.&lt;/p&gt;

&lt;p&gt;Unfortunately many bugs are becoming visible only after a bit heavier usage by the final users.&lt;/p&gt;

&lt;p&gt;Deep analysis of your code is able to spot them, before they arrive.&lt;/p&gt;

&lt;h3&gt;&lt;b&gt;Detect Platform-based Functionalities&lt;/b&gt;&lt;/h3&gt;

&lt;p&gt;While building React Native applications, you will probably have things working on one platform (f.e. iOS), but not working on the other (Android).&lt;/p&gt;

&lt;p&gt;Code audit helps you detect those “platform-based” features and functionalities, and fix them at an early stage.&lt;/p&gt;

&lt;h3&gt;&lt;b&gt;Before Final Release&lt;/b&gt;&lt;/h3&gt;

&lt;p&gt;React Native code review is also a great way (and quite obvious) for a “final checkup”.&lt;/p&gt;

&lt;p&gt;Before the release you may want to check if all works fine, and if the code is following the latest development standards.&lt;/p&gt;

&lt;h2&gt;&lt;b&gt;Reasons Summary&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;To sum it up, React Native code review may be helpful to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Find areas of improvement for your app performance&lt;/li&gt;
&lt;li&gt;Get a deep understanding of the app architecture to scale it easier&lt;/li&gt;
&lt;li&gt;Identify and uncover existing and potential bugs and problems&lt;/li&gt;
&lt;li&gt;Identify “platform-based” functionalities&lt;/li&gt;
&lt;li&gt;Keep your app in shape despite constant changes&lt;/li&gt;
&lt;li&gt;Prepare your app to be released with no flaws&lt;/li&gt;
&lt;li&gt;Making sure your app is following the latest development standards&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;&lt;b&gt;How To Do a React Native Code Review?&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;If you want to do your code review well, I suggest to start going with the following order:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;span class="has-inline-color has-vivid-red-color"&gt;Primary audit&lt;/span&gt;&lt;/strong&gt; - in this stage you go through the app structure and the fundamental functionalities.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;span class="has-inline-color has-vivid-red-color"&gt;Automatic analysis&lt;/span&gt;&lt;/strong&gt; - in this stage you push the code through the most popular automatic test engines to uncover the most frequent issues and common violations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;span class="has-inline-color has-vivid-red-color"&gt;In-depth analysis&lt;/span&gt;&lt;/strong&gt; - this is the manual part, where you extensively go through our list to uncover bugs, performance issues, potential future problems, security vulnerabilities, etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;&lt;b&gt;React Native Code Review Checklist&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;Enough theory.&lt;/p&gt;

&lt;p&gt;Let’s get to work. Here’s your React Native app Health Checklist, step-by-step:&lt;/p&gt;

&lt;h3&gt;&lt;b&gt;1. Versions&lt;/b&gt;&lt;/h3&gt;

&lt;p&gt;First, check if:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;React Native version is up to date.&lt;/li&gt;
&lt;li&gt;All dependencies are up to date.&lt;/li&gt;
&lt;li&gt;Dependencies (that use RN linking) are not deprecated and supporting latest RN version.&lt;/li&gt;
&lt;li&gt;Dependencies in package.json are meeting the industry standards.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;&lt;b&gt;2. Development&lt;/b&gt;&lt;/h3&gt;

&lt;p&gt;Then, check if:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;App is ejected/use Expo.&lt;/li&gt;
&lt;li&gt;App got own native modules written (no support from npm).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;&lt;b&gt;3. Code Quality:&lt;/b&gt;&lt;/h3&gt;

&lt;p&gt;After that, check if:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tests are written.&lt;/li&gt;
&lt;li&gt;There is a typing solution implemented (TypeScript / Prop Types / Flow).&lt;/li&gt;
&lt;li&gt;Code follow best practices.&lt;/li&gt;
&lt;li&gt;Eslint and/or prettier is added.&lt;/li&gt;
&lt;li&gt;Codebase has consistent code style.&lt;/li&gt;
&lt;li&gt;Code is easy to understand (self describing) so we can make changes without trying to understand logic for a week.&lt;/li&gt;
&lt;li&gt;Check imports through files (unused imports).&lt;/li&gt;
&lt;li&gt;Check most common usage native files and code quality in it (MainApplication etc).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;&lt;b&gt;4. Test Run&lt;/b&gt;&lt;/h3&gt;

&lt;p&gt;Finally, check if:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Development tasks are running.&lt;/li&gt;
&lt;li&gt;Build is working for any platform (Android, iOS).&lt;/li&gt;
&lt;li&gt;There are no problems with putting apps in stores.&lt;/li&gt;
&lt;li&gt;There are any CI/CD processes implemented.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;&lt;b&gt;Summary&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;React Native Code Review may appear an important step in your app development process.&lt;/p&gt;

&lt;p&gt;It helps you understand the app taken over from another developer, helps you uncover the potential problems and bugs, and finally, makes your app ready for the market.&lt;/p&gt;

&lt;p&gt;If you do it well, you can save yourself tons of work, and will make your app working well for a long time.&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>webdev</category>
      <category>codequality</category>
      <category>mobileapp</category>
    </item>
    <item>
      <title>2020 Report: React in a Business Perspective - Key Takeaways</title>
      <dc:creator>Mariusz</dc:creator>
      <pubDate>Thu, 25 Jun 2020 10:50:18 +0000</pubDate>
      <link>https://dev.to/pagepro_agency/2020-report-react-in-a-business-perspective-key-takeaways-48l7</link>
      <guid>https://dev.to/pagepro_agency/2020-report-react-in-a-business-perspective-key-takeaways-48l7</guid>
      <description>&lt;p&gt;Many years ago, we chose &lt;a href="https://reactjs.org/" rel="noreferrer noopener nofollow"&gt;React.js&lt;/a&gt; and &lt;a href="https://reactnative.dev/" rel="noreferrer noopener nofollow"&gt;React Native&lt;/a&gt; as the core of our technology stack.&lt;/p&gt;

&lt;p&gt;The longer we were working with it, the more we were satisfied with our choice, and we quickly gathered a team of &lt;a href="https://pagepro.co/" rel="noreferrer noopener"&gt;React developers&lt;/a&gt; totally dedicated to this library.&lt;/p&gt;

&lt;p&gt;However, we started investigating if this love wasn’t just a quick affair.&lt;/p&gt;

&lt;p&gt;A “halo effect”, or the BS talk we’ve been selling ourselves to help us believe we do the right thing, just because we are already doing it.&lt;/p&gt;

&lt;p&gt;So, we took the laptop, and we’ve interviewed CTOs and Dev Team Leaders to check if choosing React and React Native somehow impacted their everyday work, and ultimately, their business outcomes.&lt;/p&gt;

&lt;p&gt;What we have discovered?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TL;DR you probably guessed: most of them shared our enthusiasm.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In this article, I will show you the most important takeaways from &lt;a href="https://pagepro.co/blog/react-in-a-business-perspective/" rel="noreferrer noopener"&gt;2020 React Report&lt;/a&gt; that will tell you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why did they choose React?&lt;/li&gt;
&lt;li&gt;What actually changed since they made that choice?&lt;/li&gt;
&lt;li&gt;And what are those business benefits they are taking the advantage of?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sit back, relax, and learn how modern technology can help you make your business more efficient.&lt;/p&gt;

&lt;p&gt;Or go directly to the &lt;a rel="noreferrer noopener" href="https://pagepro.co/blog/react-in-a-business-perspective/"&gt;Report&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;What we knew and re-discovered about React&lt;/h1&gt;

&lt;p&gt;There are many benefits of using React.js, and benefits of using React Native, however, I will use the words of our survey Guests:&lt;/p&gt;

&lt;h2&gt;React saves you time and money&lt;/h2&gt;

&lt;p&gt;As every single web technology is trying to be more efficient (make things faster and easier to do), we asked CTOs if React development is going in that direction.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vmFdIWrz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/06/Q1-1024x413.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vmFdIWrz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/06/Q1-1024x413.png" alt="Survey result saying that React.js is &amp;lt;br&amp;gt;
a good technology and is moving in the right direction"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--goM7JWYX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/06/Tim-Baker-1024x211.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--goM7JWYX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/06/Tim-Baker-1024x211.png" alt="Tim Baker on the benefits of React.js"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;React boosts your team productivity&lt;/h2&gt;

&lt;p&gt;Since we started to work with React, we could experience a productivity boost. All the developers were more excited about the technology, as we could do much more with less effort.&lt;/p&gt;

&lt;p&gt;However, we wanted to make sure it’s not only our delusion.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cGD126ID--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/06/Q4-1024x342.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cGD126ID--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/06/Q4-1024x342.png" alt="Survey result saying that React.js is boosting team productivity and help with maintenance "&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DjIYJr-a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/06/David-1024x262.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DjIYJr-a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/06/David-1024x262.png" alt="David Panart on how React.js is boosting team productivity"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;CTOs want to use React&lt;/h2&gt;

&lt;p&gt;We could see in other surveys, as well as we have received many signals from the market, that React became and is still on the top of the most wanted and loved libraries.&lt;/p&gt;

&lt;p&gt;This time we asked if people are still interested in using React, after experiencing it in previous projects.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hQQIF8rt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/06/Q11-1024x388.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hQQIF8rt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/06/Q11-1024x388.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;What were the reasons behind choosing React?&lt;/h2&gt;

&lt;p&gt;We wanted to go deeper and discover more reasoning behind choosing React as a core of the technology stack.&lt;/p&gt;

&lt;p&gt;That was an open question, below the most interesting answers from our respondents:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Easy to learn and easy to use.&lt;/li&gt;
&lt;li&gt;Performance and reusability.&lt;/li&gt;
&lt;li&gt;Development time.&lt;/li&gt;
&lt;li&gt;Code sharing between web, iOS, and Android. What used to be 3 distinct codebases is now basically one.&lt;/li&gt;
&lt;li&gt;Choosing a stable and large developer ecosystem&lt;/li&gt;
&lt;li&gt;Time to market and ability to solve (most) bugs from a single code base.&lt;/li&gt;
&lt;li&gt;More in the &lt;a href="https://pagepro.co/blog/react-in-a-business-perspective/" rel="noreferrer noopener"&gt;2020 React Report&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Key Business Takeaways&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;React is making time to market shorter and allows solving (most) bugs from a single code base, which makes software delivery more efficient.&lt;/li&gt;
&lt;li&gt;React has a stable, large developer ecosystem and a wide market of available talents.&lt;/li&gt;
&lt;li&gt;Thanks to component-oriented approach and cross-platform features React is an easily scalable way of building large-scale web &amp;amp; mobile (sometimes also desktop) apps.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;What were the doubts behind choosing React?&lt;/h2&gt;

&lt;p&gt;Just the same as in the previous question, we wanted to go deeper into reasoning, yet this time, we asked our respondents about the doubts they had before they made the choice.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Before trying React we were already using Backbone, Ember, and Angular. We were afraid that we might be spreading our skills too thin and we were not going to be actually experts in any of those technologies. Fair to say that from the above, React is the only one left in our stack.&lt;/li&gt;
&lt;li&gt;Difficult to learn, adds a layer on top of native code. Often you end up having to know native fundamentals anyway.&lt;/li&gt;
&lt;li&gt;Dependency management across platforms.&lt;/li&gt;
&lt;li&gt;A massive change in the approach meant that there is a risk that we’re spending all the time trying to skill up for nothing. However, it turned out it was time well spent.&lt;/li&gt;
&lt;li&gt;Is it stable enough?&lt;/li&gt;
&lt;li&gt;More in the &lt;a href="https://pagepro.co/blog/react-in-a-business-perspective/" rel="noreferrer noopener"&gt;2020 React Report&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Key Business Takeaways&lt;/h3&gt;

&lt;p&gt;While implementing new technology to the company’s stack it’s important to check if:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This particular technology is stable enough.&lt;/li&gt;
&lt;li&gt;Is it able to fulfill your company’s needs?&lt;/li&gt;
&lt;li&gt;How to train your current dev team or hire new people with solid commercial experience?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;The biggest advantages of React&lt;/h2&gt;

&lt;p&gt;Obviously, we couldn't skip this question.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reusable components have benefited several recent projects that we’ve been involved in.&lt;/li&gt;
&lt;li&gt;Ecosystem, dev tools, new frameworks based on React are amazing.&lt;/li&gt;
&lt;li&gt;From a front end perspective, we have much more control over the performance and perceived loading times of any React site.&lt;/li&gt;
&lt;li&gt;It allows us to add iOS and Android apps to our offering as we can now use React Native in-house.&lt;/li&gt;
&lt;li&gt;Our web portals are very high quality in terms of visible user bugs.&lt;/li&gt;
&lt;li&gt;Agility and ability to build new MVP features fast.&lt;/li&gt;
&lt;li&gt;Increased speed and decreased cost.&lt;/li&gt;
&lt;li&gt;Having one way of building front-ends, across mobile apps and web apps.&lt;/li&gt;
&lt;li&gt;More in the &lt;a href="https://pagepro.co/blog/react-in-a-business-perspective/" rel="noreferrer noopener"&gt;2020 React Report&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Key Business Takeaways&lt;/h3&gt;

&lt;p&gt;While implementing new technology to the company’s stack it’s important to check if:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;After implementing React, organizations can increase development speed and decrease development costs.&lt;/li&gt;
&lt;li&gt;Thanks to React, a single team can manage multiple apps on different platforms.&lt;/li&gt;
&lt;li&gt;React allows companies to build a shareable, reusable library of inhouse components that can be used in different projects, prototypes, and platforms.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;And much more&lt;/h2&gt;

&lt;p&gt;This is just a small part of the whole &lt;a href="https://pagepro.co/blog/react-in-a-business-perspective/" rel="noreferrer noopener"&gt;2020 React Report.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, we have a clear signal on the real impact of React on the business layer.&lt;/p&gt;

&lt;p&gt;What you can learn more from the Report?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is the future of React?&lt;/li&gt;
&lt;li&gt;The best React alternatives?&lt;/li&gt;
&lt;li&gt;What are the threats of React?&lt;/li&gt;
&lt;li&gt;How hard it is to hire and onboard React developers?&lt;/li&gt;
&lt;li&gt;What is still missing in React?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Enjoy, and don’t forget to share it with people that may benefit from it.&lt;/p&gt;

&lt;p&gt;Also, send me your feedback, and if you want to take part in the next year’s survey, let me know!&lt;/p&gt;

</description>
      <category>react</category>
      <category>reactnative</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>React Native vs Flutter</title>
      <dc:creator>Mariusz</dc:creator>
      <pubDate>Thu, 18 Jun 2020 13:05:33 +0000</pubDate>
      <link>https://dev.to/pagepro_agency/react-native-vs-flutter-2nja</link>
      <guid>https://dev.to/pagepro_agency/react-native-vs-flutter-2nja</guid>
      <description>&lt;p&gt;Demand for &lt;a rel="noreferrer noopener" href="https://pagepro.co/blog/cross-platform-apps-vs-native-apps/"&gt;cross-platform applications&lt;/a&gt; is increasing. People are constantly searching for more optimal solutions such as &lt;strong&gt;&lt;a href="https://reactnative.dev/" rel="noreferrer noopener nofollow"&gt;React Native&lt;/a&gt;&lt;/strong&gt; or &lt;strong&gt;&lt;a href="https://flutter.dev/" rel="noreferrer noopener nofollow"&gt;Flutter&lt;/a&gt;&lt;/strong&gt;, where they can create &lt;a href="https://pagepro.co/mobile-app-development.html" rel="noreferrer noopener"&gt;iOS and Android apps&lt;/a&gt; using one codebase only.&lt;/p&gt;

&lt;p&gt;While using a single codebase for two applications, you do not have to invest double time, effort, and amount to create one app which is to be implemented on two different operating systems.&lt;/p&gt;

&lt;p&gt;Many solutions have been created to deal with these scenarios but two attracted most of the audience - &lt;strong&gt;React Native&lt;/strong&gt; made by Facebook and &lt;strong&gt;Flutter&lt;/strong&gt; made by Google.&lt;/p&gt;

&lt;p&gt;These two platforms have their own pros and cons which gives them an edge over others.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Flutter&lt;/strong&gt; and &lt;strong&gt;React Native&lt;/strong&gt; allow developers to build cross-platform applications by using a single programming language. React Native has been in the market much longer. As compared to Flutter due to which this platform is a lot more matured and has developed its own community and fan base.&lt;/p&gt;

&lt;h2&gt;React Native by Facebook&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6gsM4D4e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/06/react-1.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6gsM4D4e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/06/react-1.svg" alt="React Native logo" width="193" height="173"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Facebook's product, &lt;strong&gt;React Native&lt;/strong&gt; is a lot more mature as compared to other choices such as Ionic, Xamarin, PhoneGap, etc. It has a strong community that provides solutions to all sorts of problems.&lt;/p&gt;

&lt;p&gt;At this point in time, React Native is renowned as the world champion. This powerful Javascript framework is built using React library which allows you to develop iOS and Android apps using a single codebase.&lt;/p&gt;

&lt;p&gt;People actively use it all over the world and most of the organizations made it their premium choice for their mobile applications.&lt;/p&gt;

&lt;p&gt;Funny thing is that Facebook started as a hackathon project in 2013, but in 2015 it became public for the masses.&lt;/p&gt;

&lt;h2&gt;Flutter by Google&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--q3hG0YM4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/06/flutter-logo-sharing.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--q3hG0YM4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/06/flutter-logo-sharing.png" alt="Flutter logo" width="374" height="184"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Flutter&lt;/strong&gt; is the cross-platform framework that develops mobile applications by using Dart language.&lt;/p&gt;

&lt;p&gt;Both the language and framework are developed by Google and a lot of efforts and time were invested so that desired applications can be created in the easiest way which serves their purpose completely.&lt;/p&gt;

&lt;p&gt;In 2017, the initial alpha phase of Flutter was started which makes it a lot younger than React Native.&lt;/p&gt;

&lt;p&gt;Though it is new, its features and competency made it a prominent choice in much less time.&lt;/p&gt;

&lt;h2&gt;Head to Head Comparison between React Native and Flutter&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table class="has-fixed-layout"&gt;
&lt;thead&gt;&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th class="has-text-align-center"&gt;React Native&lt;/th&gt;
&lt;th class="has-text-align-center"&gt;Flutter&lt;/th&gt;
&lt;/tr&gt;&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Programming Language&lt;/strong&gt;&lt;/td&gt;
&lt;td class="has-text-align-center"&gt;JavaScript&lt;/td&gt;
&lt;td class="has-text-align-center"&gt;Dart&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Created by&lt;/strong&gt;&lt;/td&gt;
&lt;td class="has-text-align-center"&gt;Facebook&lt;/td&gt;
&lt;td class="has-text-align-center"&gt;Google&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Main Structure&lt;/strong&gt;&lt;/td&gt;
&lt;td class="has-text-align-center"&gt;Flux and Redux&lt;/td&gt;
&lt;td class="has-text-align-center"&gt;BLoC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Hot Reload&lt;/strong&gt;&lt;/td&gt;
&lt;td class="has-text-align-center"&gt;Supported&lt;/td&gt;
&lt;td class="has-text-align-center"&gt;Supported&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Release Date&lt;/strong&gt;&lt;/td&gt;
&lt;td class="has-text-align-center"&gt;Jan 2015&lt;/td&gt;
&lt;td class="has-text-align-center"&gt;May 2017&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Performance&lt;/strong&gt;&lt;/td&gt;
&lt;td class="has-text-align-center"&gt;Native-like&lt;/td&gt;
&lt;td class="has-text-align-center"&gt;Native-like&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Code Reusability&lt;/strong&gt;&lt;/td&gt;
&lt;td class="has-text-align-center"&gt;Up to 90%&lt;/td&gt;
&lt;td class="has-text-align-center"&gt;Up to 90%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Major Use Cases&lt;/strong&gt;&lt;/td&gt;
&lt;td class="has-text-align-center"&gt;Facebook &lt;br&gt;Pinterest&lt;br&gt;Instagram&lt;/td&gt;
&lt;td class="has-text-align-center"&gt;Alibaba&lt;br&gt;Groupon&lt;br&gt;Google Ads&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;Pros and Cons&lt;/h2&gt;

&lt;p&gt;We will be having a look on a few advantages and disadvantages which (I hope) allow you to make a wise and calculated decision.&lt;/p&gt;

&lt;p&gt;Both the platforms are strong enough to be used, but there are certain features that may work better for you while others need to be considered before you will make your decision in that regard.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table class="has-fixed-layout"&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td class="has-text-align-center"&gt;&lt;strong&gt;React Native&lt;/strong&gt;&lt;/td&gt;
&lt;td class="has-text-align-center"&gt;&lt;strong&gt;Flutter&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Pros&lt;/strong&gt;&lt;/td&gt;
&lt;td class="has-text-align-center"&gt;Having a hot reload feature allows it to have fast coding.&lt;br&gt;&lt;br&gt;One codebase for two mobile platforms&lt;br&gt;&lt;br&gt;Use known and widely used language - Javascript&lt;br&gt;&lt;br&gt;Facilitates to reuse the code and save cost&lt;br&gt;&lt;br&gt;Mature platform&lt;br&gt;&lt;br&gt;Supported by an active and vast community&lt;br&gt;&lt;br&gt;Easy to learn and adapt&lt;br&gt;&lt;br&gt;Less Testing&lt;br&gt;&lt;br&gt;Robust Performance&lt;/td&gt;
&lt;td class="has-text-align-center"&gt;Hot reload which means fast coding&lt;br&gt;&lt;br&gt;Requires one codebase for two different platforms&lt;br&gt;&lt;br&gt;Requires 50% less testing&lt;br&gt;&lt;br&gt;User-friendly designs&lt;br&gt;&lt;br&gt;Faster app/product development&lt;br&gt;&lt;br&gt;Less Cod&lt;br&gt;&lt;br&gt;Ideal for MVPs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Cons&lt;/strong&gt;&lt;/td&gt;
&lt;td class="has-text-align-center"&gt;Limited freedom of choice for the developer&lt;br&gt;&lt;br&gt;UI is fragile&lt;br&gt;&lt;br&gt;Apps require additional coding than the native ones&lt;br&gt;&lt;br&gt;Abandoned packages and libraries&lt;br&gt;&lt;br&gt;Not native&lt;/td&gt;
&lt;td class="has-text-align-center"&gt;The risk involved in the platform&lt;br&gt;&lt;br&gt;The limited size of the developer community&lt;br&gt;&lt;br&gt;Libraries and support is limited as compared to React Native&lt;br&gt;&lt;br&gt;Requires continuous integration support&lt;br&gt;&lt;br&gt;Size of the App&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;Performance of React Native and Flutter&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JS-cPuv3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2019/11/sebastiaan-stam-4lqMd_XBlfU-unsplash-1024x539.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JS-cPuv3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2019/11/sebastiaan-stam-4lqMd_XBlfU-unsplash-1024x539.jpg" alt="performance on the car counter"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While talking about &lt;a href="https://pagepro.co/" rel="noreferrer noopener"&gt;cross-platform applications&lt;/a&gt;, their performance and User-interface is considered as the biggest challenge.&lt;/p&gt;

&lt;p&gt;You have to provide a seamless experience which the user has while using the native application.&lt;/p&gt;

&lt;p&gt;While working around the platform of your choice, developers need to make sure that their product provides quick performance, pixel perfect design, and intuitive navigation.&lt;/p&gt;

&lt;p&gt;If you are using Google’s platform or Facebook’s you need to consider the efficiency of how you communicate with the native modules.&lt;/p&gt;

&lt;p&gt;In the case of &lt;a href="https://pagepro.co/react-native-development.html" rel="noreferrer noopener"&gt;React Native development&lt;/a&gt;, the app’s performance slows down as JavaScript needs to bridge, in order to carry out the functions, while in Flutter, Dart is built with necessary components that give immediate access.&lt;/p&gt;

&lt;p&gt;We can clearly see that Flutter has an edge in providing a sharp performance to its users.&lt;/p&gt;

&lt;h2&gt;UI and UX&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4oIEugBh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2019/10/photo-1522542550221-31fd19575a2d-1024x683.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4oIEugBh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2019/10/photo-1522542550221-31fd19575a2d-1024x683.jpeg" alt="user experience planning picture"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Most of the effectiveness of these platforms depend upon their user interface design and how things are made easy for the users and developers with the additional features provided.&lt;/p&gt;

&lt;p&gt;Flutter provides its own sets of widgets which allows it to implement the design of certain platforms or to customize them easily.&lt;/p&gt;

&lt;p&gt;While React Native only uses native UI controllers, though it has an additional ReactJS library which is also rich in UI elements. If you remove this library from the platform then you leave React Native with almost zero UI elements at our disposal.&lt;/p&gt;

&lt;p&gt;So, in the case of UI and UX, Flutter is surely winning the game.&lt;/p&gt;

&lt;h2&gt;Learning Curve&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BshkPKd---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/01/patrick-tomasso-Oaqk7qqNh_c-unsplash.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BshkPKd---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/01/patrick-tomasso-Oaqk7qqNh_c-unsplash.jpg" alt="lots of papers"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;React Native is based on Javascript which is known by the masses whereas Flutter incorporates Dart which is relatively new and has a limited set of developers as compared to the former one.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://pagepro.co/" rel="noreferrer noopener"&gt;Mobile developers&lt;/a&gt; can easily master JS and develop the desired product in a relatively less amount of time. Finding a programmer for the project would also be much easier as the talent pool is vast.&lt;/p&gt;

&lt;p&gt;React Native also supports the massive collection of libraries and ready-made components which make the job a lot more easy. More than that, the reusability of React Native components makes you save a lot of time during the execution phase, and shorten your product time-to-market.&lt;/p&gt;

&lt;p&gt;According to this aspect, RN scores the point.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;It is clearly stated that React Native is more popular and widely used due to its feasibility and extensive support, but it does not mean that Flutter lags behind.&lt;/p&gt;

&lt;p&gt;Flutter is new as compared to RN but soon it is may going to make the buzz due to its features and efficiency.&lt;/p&gt;

&lt;p&gt;React Native is currently more stable but we can surely see the growth curve of Flutter too, it is simply a matter of time when both these platforms will have their own significant set of audiences.&lt;/p&gt;

&lt;p&gt;These both are ideal choices to develop applications in a timely manner while being cost-effective solutions.&lt;/p&gt;

&lt;p&gt;Every application requires different points to be considered, so the decision entirely depends upon the organization and the developer.&lt;/p&gt;

&lt;p&gt;At this point of time, no one can predict the future regarding the winner but we can wait and watch how things turn and which platform provides more competent solutions to the problems.&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>webdev</category>
      <category>flutter</category>
      <category>mobile</category>
    </item>
    <item>
      <title>What is Headless CMS? Advantages And Other FAQ</title>
      <dc:creator>Mariusz</dc:creator>
      <pubDate>Thu, 28 May 2020 10:40:56 +0000</pubDate>
      <link>https://dev.to/pagepro_agency/what-is-headless-cms-advantages-and-other-faq-5c02</link>
      <guid>https://dev.to/pagepro_agency/what-is-headless-cms-advantages-and-other-faq-5c02</guid>
      <description>&lt;p&gt;If you’ve entered the world of web development a while ago, it’s more than likely that you heard of or used a content management system before (CMS for short), yet you may still wonder what exactly is a headless CMS. &lt;/p&gt;

&lt;p&gt;Perhaps, you know a traditional CMS like &lt;a rel="noreferrer noopener nofollow" href="https://wordpress.org/"&gt;WordPress&lt;/a&gt; or &lt;a rel="noreferrer noopener" href="https://www.drupal.org/"&gt;Drupal&lt;/a&gt;, but recent years indicate the growing popularity of headless CMSes and it’s worth wrapping your head around it.&lt;/p&gt;

&lt;p&gt;So if headless CMS doesn’t ring a bell, we will fix it. &lt;/p&gt;

&lt;p&gt;First, let’s start with some definitions.&lt;/p&gt;

&lt;h2&gt;&lt;b&gt;Traditional CMS vs Headless CMS&lt;/b&gt;&lt;/h2&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%2Fpagepro.co%2Fblog%2Fwp-content%2Fuploads%2F2020%2F03%2Fglenn-carstens-peters-1F4MukO0UNg-unsplash.jpg" 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%2Fpagepro.co%2Fblog%2Fwp-content%2Fuploads%2F2020%2F03%2Fglenn-carstens-peters-1F4MukO0UNg-unsplash.jpg" alt="a typewriter and the laptop next to each other"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's start with traditional CMSes.&lt;/p&gt;

&lt;h3&gt;&lt;b&gt;Traditional&lt;/b&gt;&lt;/h3&gt;

&lt;p&gt;Traditional CMS is a popular tool for web creation. In an easy manner, users can create and edit the content and store it on the back-end database. All those functionalities in one single system.&lt;/p&gt;

&lt;p&gt;Choosing from multiple templates and themes, the appearance can be customized and the functionalities expanded with available plugins. Those CMSes often provide a “What You See Is What You Get” (WYSIWYG) experience, making them more user-friendly for non-technical people.&lt;/p&gt;

&lt;p&gt;So typically, a &lt;strong&gt;traditional CMS consists of&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a database for storing the content,&lt;/li&gt;
&lt;li&gt;an admin panel for management,&lt;/li&gt;
&lt;li&gt;API that joins everything together,&lt;/li&gt;
&lt;li&gt;a frontend layer for displaying the content.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What’s important to understand here is that the front-end and the back-end are coupled, they are linked together.&lt;/p&gt;

&lt;p&gt;How is it different from headless CMS? Let’s find out.&lt;/p&gt;

&lt;h3&gt;&lt;b&gt;Headless&lt;/b&gt;&lt;/h3&gt;

&lt;p&gt;In a nutshell - headless CMS is a back-end only content management system.&lt;/p&gt;

&lt;p&gt;Remember that traditional CMS like Wordpress or Drupal had the front-end and back-end tightly linked, right?&lt;/p&gt;

&lt;p&gt;Headless CMS is the opposite - it decouples content management from the presentation layer. If „head” is the presentation layer (or the frontend) and „body” is the content repository -  we chop the head off the body and hence the name „headless”. What we’re left with is raw content that we can access through API calls. Our CMS is now a content-only data source.&lt;/p&gt;

&lt;p&gt;And since we no longer have a default front-end, we’re free to create as many „heads” as we wish and deliver our content to any device. That also means no restrictions on what framework or tools you use.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://snipcart.com/blog/intro-api-first-headless-cms-directus" rel="noreferrer noopener"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpagepro.co%2Fblog%2Fwp-content%2Fuploads%2F2020%2F03%2Fheadless-animation-1.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In addition, this decoupled approach makes a perfect fit for JAMstack builds.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://pagepro.co/blog/2019/11/19/what-is-jamstack" rel="noreferrer noopener"&gt; What is JAMStack?&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;&lt;b&gt;What are the benefits of headless CMS?&lt;/b&gt;&lt;/h2&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%2Fpagepro.co%2Fblog%2Fwp-content%2Fuploads%2F2019%2F11%2F2020-1024x490.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%2Fpagepro.co%2Fblog%2Fwp-content%2Fuploads%2F2019%2F11%2F2020-1024x490.png" alt="a woman touches interactive futuristic screen"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Flexibility&lt;/strong&gt; - you have full control over the appearance of your content and you can work with your favourite frameworks and tools
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enhanced security&lt;/strong&gt; - since the content publishing platform is not bound to the database - the risk of malware attacks is lower
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reusability&lt;/strong&gt; -  you can reuse and repurpose your content to serve any digital channel
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;User-friendly&lt;/strong&gt; - content delivered via API is easier to maintain and distribute, and it’s easier to edit for non-technical people
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Future-proof &lt;/strong&gt;- since the presentation and logic layers are separate you can structure your content and make it adaptable to future modifications&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;&lt;b&gt;Should you go headless?&lt;br&gt;(or not)?&lt;/b&gt;&lt;/h2&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%2Fpagepro.co%2Fblog%2Fwp-content%2Fuploads%2F2020%2F03%2Fjukan-tateisi-bJhT_8nbUA0-unsplash.jpg" 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%2Fpagepro.co%2Fblog%2Fwp-content%2Fuploads%2F2020%2F03%2Fjukan-tateisi-bJhT_8nbUA0-unsplash.jpg" alt="a child next to the big stairs"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you feel like traditional CMS is too limiting for you and you need a more flexible tool, then you should go headless. &lt;/p&gt;

&lt;p&gt;If you want to create unique websites that can be displayed on any device, then you won’t profit from a predefined template.&lt;/p&gt;

&lt;p&gt;Moreover, a traditional CMS offers you everything out-of-the-box, but as a side-effect, you’ll end up piling lots of unnecessary code. &lt;/p&gt;

&lt;p&gt;That’s not the case with headless CMS where you can choose to integrate only the functionalities that you actually need.&lt;/p&gt;

&lt;p&gt;And as mentioned before, it’s technology-agnostic, meaning you’re not restricted to a specific tech stack. It’s a developer-friendly solution. It’s perfect for use cases such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;websites and apps based on any JavaScript framework (&lt;a href="https://pagepro.co/blog/2019/11/15/reasons-to-use-react-in-2020" rel="noreferrer noopener"&gt;React&lt;/a&gt;, VueJS, AngularJS),&lt;/li&gt;
&lt;li&gt;sites made with a static site generator ( i.e. &lt;a href="https://pagepro.co/blog/2019/12/09/is-gatsbyjs-the-best-framework-for-building-static-websites-what-are-the-other-alternatives/" rel="noreferrer noopener"&gt;Gatsby&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;delivering content to multiple channels.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But if you don’t have the technical resources, or you don’t rely on developers to manage the content, it might make more sense to use a traditional CMS. &lt;/p&gt;

&lt;p&gt;Especially if you’re working on a small project like a personal site or blog, it’d be easier and cheaper to use a template than build everything from scratch. So keep in mind that sometimes a traditional CMS might be the right choice for you.&lt;/p&gt;

&lt;h2&gt;&lt;b&gt;Headless CMS platforms&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;Here’s a list of some of the most popular headless CMS platforms right now:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://pagepro.co/blog/2020/03/04/what-is-strapi-and-how-to-build-your-first-api/" rel="noreferrer noopener"&gt;Strapi&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.datocms.com/" rel="noreferrer noopener"&gt;DatoCMS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.contentful.com/" rel="noreferrer noopener"&gt;Contentful&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://directus.io/" rel="noreferrer noopener"&gt;Directus&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://graphcms.com/" rel="noreferrer noopener"&gt;GraphCMS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;and many more…&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;&lt;b&gt;Headless CMS in use - examples&lt;/b&gt;&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.economist.com/" rel="noreferrer noopener"&gt;The Economist&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://wallflowerglobal.com/casestudy/burger-king/" rel="noreferrer noopener"&gt;Burger King digital menu boards &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.augment.com/blog/3-consumer-giants-who-used-augmented-reality-for-retail/" rel="noreferrer noopener"&gt;Ikea AR mobile app &lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;The future is searching for more and more interesting ways to delight users with their experience and Headless is one that is definitely the most interesting one at the moment.&lt;/p&gt;

&lt;p&gt;I hope I helped you got more familiar with this subject and you are now more ready to give it a try.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>headless</category>
      <category>javascript</category>
      <category>react</category>
    </item>
    <item>
      <title>React Native FAQ for 2020</title>
      <dc:creator>Mariusz</dc:creator>
      <pubDate>Fri, 22 May 2020 08:51:11 +0000</pubDate>
      <link>https://dev.to/maniekm/react-native-faq-for-2020-3mgd</link>
      <guid>https://dev.to/maniekm/react-native-faq-for-2020-3mgd</guid>
      <description>&lt;p&gt;If you are familiar with the basics of React Native, and just wondering about business and development advantages for 2020, go to the bottom of the article with "Pros and Cons" and "Development advantages AD 2020".&lt;/p&gt;

&lt;p&gt;If you are not, keep reading from the top.&lt;/p&gt;

&lt;h2&gt;&lt;b&gt;What is React Native?&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LS4X9NFz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/react-native-logo-884x1024.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LS4X9NFz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/react-native-logo-884x1024.png" alt="react native logo" width="177" height="205"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You probably know &lt;a href="https://pagepro.co/react-native-development.html" rel="noreferrer noopener"&gt;React Native development&lt;/a&gt; as an open-source mobile app platform created in &lt;a rel="noreferrer noopener" href="https://www.javascript.com/"&gt;JavaScript&lt;/a&gt; that is taking the mobile app development market by the storm.&lt;/p&gt;

&lt;p&gt;It has&lt;a rel="noreferrer noopener" href="https://pagepro.co/blog/2020/01/16/how-react-native-can-cut-your-development-costs/"&gt; a number of great advantages that are saving you many development costs&lt;/a&gt; and makes your app truly outstanding. &lt;/p&gt;

&lt;p&gt;However, like any other platform, it has its cons as well.&lt;/p&gt;

&lt;p&gt;So, before you add it to your tech stack, let's go over the FAQ that I think every developer should be familiar with.&lt;/p&gt;

&lt;h2&gt;&lt;b&gt;Why we needed React Native?&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vSGBiQpt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/02/howtobuilanapp-1024x489.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vSGBiQpt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/02/howtobuilanapp-1024x489.png" alt="People designing an app on a big piece of paper "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before React Native arrived at the market, people wanted to build mobile apps mostly in native platforms.&lt;/p&gt;

&lt;p&gt;It was mainly related to the high performance, and great customized user experience. &lt;/p&gt;

&lt;p&gt;But they had their limitations as well.&lt;/p&gt;

&lt;p&gt;For instance, native development environments were only working for a certain OS. That means, in order to develop applications for different platforms, you need a help of different developers.&lt;/p&gt;

&lt;p&gt;Thanks to React Native, developers could work around a single tool to develop cross-platform applications with a truly native experience. &lt;/p&gt;

&lt;p&gt;More than that, cross-platform development and React community is constantly growing, Many functionalities we consider impossible few years ago, are now working perfectly without a need for native development. &lt;/p&gt;

&lt;h2&gt;&lt;b&gt;What’s the difference between React and React Native?&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ekiqsse3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/Screenshot-2020-03-17-at-10.41.24-1024x802.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ekiqsse3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/Screenshot-2020-03-17-at-10.41.24-1024x802.png" alt="react vs react native logos" width="346" height="271"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The difference is quite simple. &lt;/p&gt;

&lt;p&gt;We use &lt;a rel="noreferrer noopener" href="https://pagepro.co/react-development.html"&gt;React&lt;/a&gt; for web apps, and React Native to develop mobile apps.&lt;/p&gt;

&lt;p&gt;Where React focuses more on improved UI (User Interface), React Native is sharing a common logic layer for all OS. That provides solutions to problems which were being dealt for quite a while now, such as development inefficiency, slower time to deployment and less developer productivity. &lt;/p&gt;

&lt;p&gt;It is important to note that React is a &lt;strong&gt;library&lt;/strong&gt; used for web development whereas React Native is a &lt;strong&gt;platform&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Another interesting thing is when you want to use React Native, you have everything you need to start a project. On the other hand, starting a new project with React means you have to select the bundler and figure out the modules which will work best.&lt;/p&gt;

&lt;h2&gt;&lt;b&gt;Who is using React Native?&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3CE5TrSj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/02/howtobuild1-1024x678.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3CE5TrSj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/02/howtobuild1-1024x678.png" alt="man holding a phone with an app"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You may hear that big players are considering React Native as their development platform more often.&lt;/p&gt;

&lt;p&gt;Here's only a small chunk of them:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EWmx_IOa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/Screenshot-2020-03-18-at-10.14.39-1024x528.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EWmx_IOa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/Screenshot-2020-03-18-at-10.14.39-1024x528.png" alt="Apps built in react native"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The list goes long and probably will keep on increasing as React Native is delivering the features and support that is hard to find anywhere else.&lt;/p&gt;

&lt;h2&gt;&lt;b&gt;Pros and Cons of React Native&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Zo5P16Ho--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/glenn-carstens-peters-RLw-UC03Gwc-unsplash.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Zo5P16Ho--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/glenn-carstens-peters-RLw-UC03Gwc-unsplash.jpg" alt="man is making a list on a notepad"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The most important advantages of React Native are the ones regarding development efficiency and economy. &lt;/p&gt;

&lt;p&gt;Although there are still some areas that native development is doing better, you may want to consider very carefully when React Native is a good choice for you specifically. &lt;a href="https://pagepro.co/blog/2020/02/12/when-does-it-make-sense-to-use-react-native/" rel="noreferrer noopener"&gt;You can read about it in another article&lt;/a&gt;. &lt;/p&gt;

&lt;h3&gt;&lt;b&gt;Pros&lt;/b&gt;&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Development speed&lt;/strong&gt; &lt;strong&gt;(cost)&lt;/strong&gt; - what &lt;a rel="noreferrer noopener" href="https://pagepro.co/blog/2019/11/15/reasons-to-use-react-in-2020/"&gt;developers love about React&lt;/a&gt; is that &lt;strong&gt;they’re able to reuse and recycle components&lt;/strong&gt; developed before by them and wide React Native ecosystem. They can also share their codebase and make them work faster.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Works everywhere &lt;/strong&gt;- Once you learn (hire) React Native, you can build apps for iOS, Android, and Windows.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;User Experience&lt;/strong&gt; - as long as you are not using extremely complicated designs and interactions, you are still able to build high-performance apps and deliver absolutely great user experience. 
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Faster time to market&lt;/strong&gt; - you can arrive on the market much faster to test your MVP, get feedback and adapt changes accordingly without a need for a big investment.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Help on demand&lt;/strong&gt; - React Native community is massive. Many problems that you may face during development, may already be fixed somewhere out there.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Maintenance cost&lt;/strong&gt; - you only deal with one codebase. 
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;React Native apps are visible&lt;/strong&gt; - they get listed in AppStore and Play Store. Not like PWA. &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;&lt;b&gt;Cons&lt;/b&gt;&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Performance is still lower than native&lt;/strong&gt; - React Native is not able to use all the blessings and potential of a specific platform. Native apps on the other hand, can really maximize functionalities and deliver the ultimate user experience in the result.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not efficient design-wise &lt;/strong&gt;- If you consider complicated designs or advanced interactions as a crucial part of your business advantage, you should definitely go for native development.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Custom modules&lt;/strong&gt; - you can access many custom modules, yet, there may be a need for some specific components that you will have to build from scratch yourself. &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;&lt;b&gt;Development advantages of React Native AD 2020&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JuAADjDf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/thewayofcolor-GAFrXUDOJFA-unsplash.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JuAADjDf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/thewayofcolor-GAFrXUDOJFA-unsplash.jpg" alt="men playing chess"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are still few things you should know that may appear crucial in your teck stack decision: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Easy to work with &lt;/strong&gt;– experienced developers will definitely appreciate the development experience. Meaningful error messages, time-saving and robust tools make it a premium choice over other platforms.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Changes preview&lt;/strong&gt; – you don’t have to rebuild the application, again and again, to see changes. It saves a lot of time and makes things quick and efficient. Hit “Command+R” to refresh the application.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Quick iteration cycles &lt;/strong&gt;– which just simply adds more value.&lt;/li&gt;
&lt;li&gt;
&lt;b&gt;Intelligent debugging tools&lt;/b&gt; – and error reporting mechanisms. Give it an advantage over others and allows developers to focus more on the productive part.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Easier to debug&lt;/strong&gt; – uses Flipper as default.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep things minimal and worthy&lt;/strong&gt; – it doesn’t force you to work in Xcode or Android Studio for iOS or android apps respectively.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A large community of developers&lt;/strong&gt; – who are contributing day in, day out.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Code reusability &lt;/strong&gt;– developers can easily integrate 90% of the native framework and reuse the code for any platform. This feature not only saves time but also helps to cut down the cost of building two apps. Cool thing is that you can use the web app code (written in React) for mobile apps.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pre-developed components &lt;/strong&gt;– numerous open-source libraries are available to accelerate your work.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Live reloading feature&lt;/strong&gt; – it helps to compile and read the file from the point where the developer made changes. Then a new file is offered to the stimulator which automatically reads the file from the beginning.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compatible with third-party plugins&lt;/strong&gt; – and does not require high memory to process. You don't need any specific web views functions and all native modules are linked with the plugin through the framework. Smoother running and faster loading are key features for it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Transform web projects into mobile applications&lt;/strong&gt; – work done on this platform is easy to understand, and anyone can work around it although they were not previously engaged in it. It increases flexibility and web updates become consistent.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Smoother and faster UI&lt;/strong&gt; – as compared to classic hybrid ones. The interface created through React Native is highly responsive and feels fluid.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;&lt;b&gt;Summary&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;React Native is an exciting framework that enables web developers to create mobile applications that have knowledge in React and JavaScript.&lt;/p&gt;

&lt;p&gt;It enables faster mobile development and efficient code sharing for all operating systems without compromising on the quality of the product.&lt;/p&gt;

&lt;p&gt;High efficiency and low costing are also the attributes that make work exciting for armies of developers.&lt;/p&gt;

&lt;p&gt;Supported by the biggest players on the market, this technology will probably stand a test of time and will only get better.&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Pros And Cons of Using Gatsby in WordPress Projects</title>
      <dc:creator>Mariusz</dc:creator>
      <pubDate>Thu, 30 Apr 2020 12:13:58 +0000</pubDate>
      <link>https://dev.to/pagepro_agency/pros-and-cons-of-using-gatsby-in-wordpress-projects-3gc2</link>
      <guid>https://dev.to/pagepro_agency/pros-and-cons-of-using-gatsby-in-wordpress-projects-3gc2</guid>
      <description>&lt;p&gt;Merging &lt;a href="http://www.gatsbyjs.org" rel="noreferrer noopener nofollow"&gt;Gatsby&lt;/a&gt; with WordPress became a &lt;a href="https://2019.stateofjs.com/overview/" rel="noreferrer noopener nofollow"&gt;really hot topic this year&lt;/a&gt; and &lt;/p&gt;

&lt;p&gt;Thanks to &lt;a rel="noreferrer noopener" href="https://pagepro.co/blog/2019/10/09/how-gatsbyjs-can-help-your-business-to-overtake-competition/"&gt;many business advantages&lt;/a&gt;, more and more companies are adapting Gatsby as a part of their tech stack, which makes &lt;a rel="noreferrer noopener" href="https://pagepro.co/"&gt;React and Gatsby developers&lt;/a&gt; in high demand as well.&lt;/p&gt;

&lt;p&gt;As WordPress is one of the most popular CMS and website creator, the popularity of Gatsby raised a question in the content environment: “Is Gatsby better or worse than WordPress?”.&lt;/p&gt;

&lt;p&gt;But my question is: “Does it have to be better or worse than WordPress?”&lt;/p&gt;

&lt;p&gt;What if both technologies could work together and combine the best of them?&lt;/p&gt;

&lt;p&gt;Does that relationship make sense?&lt;/p&gt;

&lt;h2&gt;&lt;b&gt;Why using Gatsby with WordPress?&lt;/b&gt;&lt;/h2&gt;

&lt;h3&gt;1. Modern performance&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TqBY-47h--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/nathan-duck-KnLj3o9A66E-unsplash.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TqBY-47h--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/nathan-duck-KnLj3o9A66E-unsplash.jpg" alt="a man in a futuristic spaceship"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using &lt;a href="https://pagepro.co/gatsby-development.html"&gt;Gatsby Development&lt;/a&gt; means using all the blessings of &lt;a href="https://pagepro.co/react-development.html"&gt;React&lt;/a&gt; and GraphQL - the hottest modern frontend libraries.&lt;/p&gt;

&lt;p&gt;It opens up many possibilities to create a &lt;a href="https://pagepro.co/blog/2019/11/22/7-reasons-why-you-should-be-using-react/"&gt;truly outstanding and fully customized user experience&lt;/a&gt;, with additional website performance and speed boost.&lt;/p&gt;

&lt;p&gt;GatsbyJS is a Static PWA Generator. Once loaded, Gatsby prefetches resources for other pages so clicking around the site feels incredibly fast.&lt;/p&gt;

&lt;h3&gt;2. Gatsby's Security&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wsjECy_9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/Screenshot-2020-03-13-at-21.13.22-1024x597.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wsjECy_9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/Screenshot-2020-03-13-at-21.13.22-1024x597.png" alt="Gatsby logo on the wall"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the case of security, WordPress has a lot to catch up, and this is where Gatsby comes in as a hero.&lt;/p&gt;

&lt;p&gt;Again, Static Site Generators are extremely safe, as there is no direct connection to the database, dependencies, user data or other sensitive information.&lt;/p&gt;

&lt;h3&gt;3. Plugin free&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wVm0eZ2o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/dawid-zawila-zb2vBaHYB2I-unsplash.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wVm0eZ2o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/dawid-zawila-zb2vBaHYB2I-unsplash.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Having a look from a non-developer’s point of view, many people use WordPress, as it is quite easy to operate with.&lt;/p&gt;

&lt;p&gt;If there is a need to take care of something simple, like content editing, or small layout changes, they can easily handle it themselves without the help of a developer.&lt;/p&gt;

&lt;p&gt;However, if a non-developer want’s to adopt any custom functionalities, he is fully dependent on WordPress plugins, which makes it very limited in case of user experience and customization, so in order to get what they want, they just add plugins one after another.&lt;/p&gt;

&lt;p&gt;What they often don’t know, is that running each plugin is like loading a new library.&lt;/p&gt;

&lt;p&gt;So by using too many of them, and putting plugins one on top of another, it makes their website extremely heavy and hard to render, which ultimately means - VERY SLOW.&lt;/p&gt;

&lt;h3&gt;4. Development pleasure&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KztywmcL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/nicole-wolf-xTBn1YBrTE-unsplash.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KztywmcL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/nicole-wolf-xTBn1YBrTE-unsplash.jpg" alt="a female developer next to laptop with coffee on a table"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Gatsby opens up many technological possibilities that can be highly beneficial for the project.&lt;/p&gt;

&lt;p&gt;The developer has more freedom in choosing tools, which allows them to make a truly customized and outstanding both user and development experience.&lt;/p&gt;

&lt;h3&gt;5. Your content is already there&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BshkPKd---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/01/patrick-tomasso-Oaqk7qqNh_c-unsplash.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BshkPKd---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/01/patrick-tomasso-Oaqk7qqNh_c-unsplash.jpg" alt="many books in chaotic order"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you're thinking about migration to use new technologies to be able to do more, you don’t have to be afraid of your previous content as well.&lt;/p&gt;

&lt;p&gt;With Gatsby, there is no need to migrate any content, as it’s already there, in your WordPress CMS.&lt;/p&gt;

&lt;h3&gt;6. More reasons why use Gatsby with WordPress:&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Easy to manage and well-known WordPress admin panel&lt;/li&gt;
&lt;li&gt;Ready to use user login system and authorization&lt;/li&gt;
&lt;li&gt;Highly developed, yet easily customized WordPress API&lt;/li&gt;
&lt;li&gt;With Gatsby and Gutenberg (new editor) you can build a drag’n’drop Gatsby site builder&lt;/li&gt;
&lt;li&gt;Lower hosting costs&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;&lt;b&gt;Why not using Gatsby with WordPress?&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;Like any relationship, this one also has its problems.&lt;/p&gt;

&lt;p&gt;Most importantly, WordPress is a blogging platform and it doesn’t always find itself as a headless backend, mostly because it still uses “old” technologies, like PHP, and is slower than other backend platforms, like Strapi or Contentful.&lt;/p&gt;

&lt;p&gt;Let’s dive a bit deeper.&lt;/p&gt;

&lt;h3&gt;1. New knowledge is required&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--74P2HDTw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/siora-photography-hgFY1mZY-Y0-unsplash.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--74P2HDTw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/siora-photography-hgFY1mZY-Y0-unsplash.jpg" alt="a girl hitting her face with a book"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want to work with Gatsby and WordPress at the same time, you ultimately need to be well familiar with both PHP and JS languages.&lt;/p&gt;

&lt;p&gt;Gatsby is also a mix of React and GraphQL, so they are required to be known as well.&lt;/p&gt;

&lt;p&gt;However, from other perspectives, it’s a great opportunity to start thinking  React-wise and broaden development horizons.&lt;/p&gt;

&lt;p&gt;Learning React and GraphQL may also appear a great idea, as both technologies are taking the fruits of technological boom and probably will stay on a higher shelf for a little longer.&lt;/p&gt;

&lt;p&gt;However, we mentioned it earlier - non-devs will hate. Or simply they won’t be able to act.&lt;/p&gt;

&lt;h3&gt;2. Losing many WordPress abilities and functionalities&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--L18Ljuzx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/Screenshot-2020-03-13-at-21.11.54-1024x838.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--L18Ljuzx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/Screenshot-2020-03-13-at-21.11.54-1024x838.png" alt="dying rose"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By mixing Gatsby with WordPress, WP is becoming backend only, which means we are losing a lot of its functionalities and abilities.&lt;/p&gt;

&lt;p&gt;For example, you cannot use theme Hooks.&lt;/p&gt;

&lt;p&gt;WooCommerce, for instance, is using native WP hooks but is also able to add his own hooks, which enables him to customize many actions. Actually, you can get into any phase of order and modify, or completely change the action (like checkout).&lt;/p&gt;

&lt;p&gt;To make it possible with Gatsby, you need to write the connection with the API from scratch.&lt;/p&gt;

&lt;p&gt;Another thing is the plugins.&lt;/p&gt;

&lt;p&gt;If you want any plugin to work correctly, you have to program it yourself by using its API. The problem is, not every plugin is sharing his API, which means you won’t be able to make it compatible.&lt;/p&gt;

&lt;h3&gt;3. Content Changes&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zyCv-4_U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/Screenshot-2020-03-13-at-21.12.42-1024x741.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zyCv-4_U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/Screenshot-2020-03-13-at-21.12.42-1024x741.png" alt="typewriter with an empty paper"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As I wrote already, Gatsby is a static site generator, which means it cannot be “just edited”, and any (even small text) change will require a new deployment.&lt;/p&gt;

&lt;p&gt;So if you have a page that requires many daily content changes, you may find it both time-consuming and irritating.&lt;/p&gt;

&lt;p&gt;Also, if your content is distributed through many channels, and has its own specific and very strict modeling, Gatsby may not be able to execute it correctly.&lt;/p&gt;

&lt;h2&gt;&lt;b&gt;Wrap up&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;Combining Gatsby with WordPress is relatively fresh (or at least refreshed lately) topic, and I suppose the number of initiatives around it will just increase.&lt;/p&gt;

&lt;p&gt;Gatsby is one of the hottest technologies at the moment, and just the same as React and GraphQL, he is gathering more and more fans around.&lt;/p&gt;

&lt;p&gt;Yet, we still have to remember that WordPress powers 35% of the internet and surely doesn’t stop.&lt;/p&gt;

&lt;p&gt;This is also why many new technologies are working and searching for possibilities and solutions to collaborate.&lt;/p&gt;

&lt;p&gt;The future seems interesting, but as always, let’s see what happens.&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>gatsby</category>
      <category>webdev</category>
    </item>
    <item>
      <title>When React Native Make Sense?</title>
      <dc:creator>Mariusz</dc:creator>
      <pubDate>Fri, 24 Apr 2020 11:22:24 +0000</pubDate>
      <link>https://dev.to/pagepro_agency/when-react-native-make-sense-3oi9</link>
      <guid>https://dev.to/pagepro_agency/when-react-native-make-sense-3oi9</guid>
      <description>&lt;p&gt;I wrote this article to answer one of the most frequently asked questions while talking about React Native on business meetings: &lt;/p&gt;

&lt;p&gt;&lt;i&gt;"What makes RN the best option for my app?"&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;I've decided to take a while and make research, together with our developers, to find out when React Native is an actual good technology choice.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/facebook/react-native"&gt;React Native&lt;/a&gt; is an open-source framework to build mobile apps with &lt;a href="https://reactjs.org/"&gt;React&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The whole aim of RN is to &lt;strong&gt;make it easier for cross-platform development&lt;/strong&gt;, as you don’t have to develop iOS, Android and Windows separately. &lt;/p&gt;

&lt;p&gt;All you need is one codebase to &lt;a href="https://pagepro.co/react-native-development.html"&gt;create an awesome app&lt;/a&gt; that works on all operating systems.&lt;/p&gt;

&lt;p&gt;However, we all know cross-platform development has cons in comparison with native apps.&lt;/p&gt;

&lt;p&gt;So, when does it make sense to use React Native?&lt;/p&gt;

&lt;h2&gt;&lt;b&gt;When your app is following regular design principles&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SbyEUHnS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/02/classic.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SbyEUHnS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/02/classic.png" alt="a phone with an app in a classic style"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have to admit that the great thing about native development is that it’s doing better with apps that are very demanding design-wise.&lt;/p&gt;

&lt;p&gt;But let’s be honest. &lt;strong&gt;We don’t need any complex designs and extreme interactions&lt;/strong&gt;, or animations to make things happen and &lt;strong&gt;make people click a purchase button. &lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We can be still great with a regular, minimalistic “look and feel”, &lt;strong&gt;as long as we fix our customers’ problem&lt;/strong&gt; with the speed and efficiency they expect. No fancy design needed. &lt;/p&gt;

&lt;p&gt;Of course, fun interactions can improve user-experience at some point, but in most cases, &lt;strong&gt;instead of spending money on two native developers&lt;/strong&gt; that need a lot of time (and probably a help of designer) to make it happen, you can just &lt;strong&gt;use React Native and get a great user-minded interface&lt;/strong&gt;, that will just make your app efficient.&lt;/p&gt;

&lt;p&gt;More than that, thanks to a great community and modularity, &lt;strong&gt;you can easily use many ready-to-use projects or components&lt;/strong&gt; that already has a proven record for being efficient.&lt;/p&gt;

&lt;p&gt;Last, but not least, technology is constantly moving and changing. Don’t forget that &lt;a href="https://pagepro.co/blog/2019/11/15/reasons-to-use-react-in-2020/"&gt;many things we take for granted today, was considered impossible two years ago.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I personally believe that React Native is a great tool for 95% of B2B mobile apps and 60% B2C mobile apps.&lt;/p&gt;

&lt;h2&gt;&lt;b&gt;When you want to release iOS and Android apps at the same time&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xRnbdtVZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/01/1vs1-1024x704.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xRnbdtVZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/01/1vs1-1024x704.png" alt="android and apple logo against react logo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s get back to the moment I wrote: &lt;i&gt;“instead of spending money on two native developers…”. &lt;/i&gt;&lt;/p&gt;

&lt;p&gt;If you’re going to be releasing your app on both Android and iOS, React Native will prove helpful as &lt;strong&gt;you’ll be able to repurpose a lot of your code rather than having to start from scratch&lt;/strong&gt; on each platform. &lt;/p&gt;

&lt;p&gt;That’ll save you both time and money, and allows you to go out with a MVP sooner.&lt;/p&gt;

&lt;p&gt;More than that,  it’s going to be &lt;strong&gt;quicker to train iOS and Android (or any other) team in React&lt;/strong&gt; than to train new iOS or Android developers separately.&lt;/p&gt;

&lt;h2&gt;&lt;b&gt;When you want to cut development time&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3MlnJ1uX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/02/time.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3MlnJ1uX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/02/time.jpg" alt="a clock standing on laptop with a lot of code on the screen"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is not related to the previous point. &lt;/p&gt;

&lt;p&gt;I’m talking here about the &lt;strong&gt;overall development experience of creating apps&lt;/strong&gt; with React Native. Big players already learned that development is just easier and more productive with it. &lt;/p&gt;

&lt;p&gt;For example, &lt;a href="https://engineering.shopify.com/blogs/engineering/react-native-future-mobile-shopify"&gt;Shopify went full gas with switching from native development to React Native&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;What they discover? &lt;/p&gt;

&lt;p&gt;&lt;i&gt;"[…]in rewriting the Arrive app in React Native, the team felt that they were twice as productive than using native development—even just on one mobile platform."&lt;/i&gt;&lt;/p&gt;

&lt;h2&gt;&lt;b&gt;When you don’t want  to double or triple your dev team&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/p6Yr8mO7mJblC/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/p6Yr8mO7mJblC/giphy.gif" alt="agent smith from Matrix is cloning" width="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Speaking of developer’s productivity, would you like &lt;strong&gt;one guy to make one app that works on both mobile and web&lt;/strong&gt;? &lt;/p&gt;

&lt;p&gt;Can do. &lt;/p&gt;

&lt;p&gt;React Native is a subset of React, and as long as you are not using any modules that need typical native functionalities, you can build an app that will work on both mobile and web platforms with the similar UI.&lt;/p&gt;

&lt;h2&gt;&lt;b&gt;When you don’t have many animations&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--skVm3ji2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/02/comic.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--skVm3ji2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/02/comic.jpg" alt="a raw hand draft of an app"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;React Native is there to help you create truly native experiences, as it allows JavaScript code to interact with native components via a mechanism known as the bridge. &lt;/p&gt;

&lt;p&gt;Although, the bridge does cause issues when it comes to things like animations. &lt;/p&gt;

&lt;p&gt;As React Native is open-source, it’s constantly improving as third parties are busy building solutions that benefit everyone. Plus, Facebook is working on changes to improve Bridge performance. &lt;/p&gt;

&lt;p&gt;However, finally, &lt;strong&gt;someone has to do those animations&lt;/strong&gt;, which means you need another person in your team, and it won’t be quick, nor cheap, but this you need to calculate yourself. &lt;/p&gt;

&lt;p&gt;If &lt;strong&gt;animations are not crucial&lt;/strong&gt; to run your business, there is just no one reason to go for native development.&lt;/p&gt;

&lt;h2&gt;&lt;b&gt;Points for using React Native&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OoH7JzFp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/02/points.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OoH7JzFp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/02/points.jpg" alt="darts in the middle of a dart board"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you’re still not sure if React Native makes sense, here are some benefits for you to keep in mind. If you’re looking for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Quicker development times&lt;/li&gt;
&lt;li&gt;Smaller development teams&lt;/li&gt;
&lt;li&gt;Quicker regression tests&lt;/li&gt;
&lt;li&gt;Bugs that get fixed easier&lt;/li&gt;
&lt;li&gt;Easy and intuitive interface&lt;/li&gt;
&lt;li&gt;Access to many ready-to-use templates and modules&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pagepro.co/blog/2020/01/16/how-react-native-can-cut-your-development-costs/"&gt;Development cost-efficiency &lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;…then, React Native makes sense to you.&lt;/p&gt;

&lt;h2&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;In fact, there is not much to be added in the conclusion, as it seems to be very obvious: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you are a big company, or a game, that has a wish to use complicated and demanding designs, or interactions, that can afford two different developers and a designer at the same time - go native.&lt;/li&gt;
&lt;li&gt;Other - go for React Native. &lt;strong&gt;Your business will be more than fine.&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>reactnative</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Generics in Typescript – How To Type Reusable Parts of Code?</title>
      <dc:creator>Mariusz</dc:creator>
      <pubDate>Mon, 30 Mar 2020 08:47:40 +0000</pubDate>
      <link>https://dev.to/pagepro_agency/generics-in-typescript-how-to-type-reusable-parts-of-code-3729</link>
      <guid>https://dev.to/pagepro_agency/generics-in-typescript-how-to-type-reusable-parts-of-code-3729</guid>
      <description>&lt;p&gt;If you follow the DRY rule in writing your code in Typescript, the Generic Types are for you! &lt;/p&gt;

&lt;p&gt;Thanks to Generic Types you can easily create reusable functions, interfaces or classes instead of writing single types for each one. &lt;/p&gt;

&lt;p&gt;Generics allow you to use different types of providing parameters to one reusable part of code.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;&amp;gt;&lt;/code&gt; syntax is reserved for describing generic type. Between the &lt;code&gt;&amp;lt;&amp;gt;&lt;/code&gt; you can provide type which can also take default or static values.&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;User&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;string&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;nick&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;T&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;User&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;nick&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;User1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;User&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;User2&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;nick&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;User2&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;&lt;b&gt;Let’s get some practice!&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;We would like to create a simple React App with TS which displays 3 titles of fetched posts with author name, loader if data is fetching and the error if we couldn't get data somehow.&lt;/p&gt;

&lt;p&gt;To understand how it exactly works, let’s start with creating two custom hooks - one for fetching user data and the second one to get post data.&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// First hook&lt;/span&gt;

&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;User&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;username&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Interface which describes data returned by useUsersFetch hook &lt;/span&gt;
&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;ReturnedUserData&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="nl"&gt;data&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="nx"&gt;User&lt;/span&gt;&lt;span class="p"&gt;[];&lt;/span&gt;
 &lt;span class="nl"&gt;error&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;loading&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;boolean&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;useUsersFetch&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="nx"&gt;ReturnedUserData&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;fetchedData&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setFetchedData&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;
   &lt;span class="nx"&gt;ReturnedUserData&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
     &lt;span class="na"&gt;loading&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
 &lt;span class="p"&gt;});&lt;/span&gt;

 &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;useEffect&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fetchData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;void&lt;/span&gt;&lt;span class="o"&gt;&amp;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;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="kd"&gt;const&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;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;axios&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;base&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/users`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

       &lt;span class="nx"&gt;setFetchedData&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="na"&gt;loading&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
     &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="nx"&gt;setFetchedData&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
         &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
         &lt;span class="na"&gt;loading&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
         &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Sth went wrong.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
       &lt;span class="p"&gt;});&lt;/span&gt;
     &lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="p"&gt;};&lt;/span&gt;

   &lt;span class="nx"&gt;fetchData&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
 &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[]);&lt;/span&gt;

 &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;fetchedData&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;// Second hook&lt;/span&gt;

&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;Post&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="nl"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Interface which describes data returned by usePostsFetch hook &lt;/span&gt;
&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;ReturnedPostsData&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="nl"&gt;data&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="nx"&gt;Post&lt;/span&gt;&lt;span class="p"&gt;[];&lt;/span&gt;
 &lt;span class="nl"&gt;error&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;loading&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;boolean&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;usePostsFetch&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="nx"&gt;ReturnedPostsData&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;fetchedData&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setFetchedData&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ReturnedPostsData&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
   &lt;span class="na"&gt;loading&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
 &lt;span class="p"&gt;});&lt;/span&gt;

 &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;useEffect&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fetchData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;void&lt;/span&gt;&lt;span class="o"&gt;&amp;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;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="kd"&gt;const&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;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;axios&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;base&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/posts`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

       &lt;span class="nx"&gt;setFetchedData&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="na"&gt;loading&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
     &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="nx"&gt;setFetchedData&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
         &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
         &lt;span class="na"&gt;loading&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
         &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Sth went wrong.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
       &lt;span class="p"&gt;});&lt;/span&gt;
     &lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="p"&gt;};&lt;/span&gt;

   &lt;span class="nx"&gt;fetchData&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
 &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[]);&lt;/span&gt;

 &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;fetchedData&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;We have 2 separate hooks to get users and posts data. &lt;/p&gt;

&lt;p&gt;It is not written with DRY rule, so how we can optimize our code to be more reusable if we want to make more requests in our app?&lt;/p&gt;

&lt;p&gt;Let’s check the difference between following hooks and move them to arguments of our new reusable hook.&lt;br&gt;&lt;br&gt;First of all, let's analyze the differences. &lt;/p&gt;

&lt;p&gt;As we can see there are a few dissimilar things like url to the endpoint, returned type of data, and hook state type. So what we can do with it?&lt;/p&gt;

&lt;p&gt;We need to create a custom hook that we will be calling useFetch with reusable logic. This hook will have one argument which is url. &lt;/p&gt;

&lt;p&gt;But how we can pass specific type of returned data to our logic? &lt;/p&gt;

&lt;p&gt;Well, our superheroes are GENERICS TYPES. &lt;/p&gt;

&lt;p&gt;Let’s do it.&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="cm"&gt;/* ReturnedData&amp;lt;T&amp;gt; is an interface which describes data returned by 
hook. Here we use previous interface body but we need to add generics 
type. Thanks to that it is more reusable and data can be any of type
passed as T.*/&lt;/span&gt;
&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;ReturnedData&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;T&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;data&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="nx"&gt;T&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;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;loading&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;boolean&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// FetchedData is a type passed to useFetch during calling a hook.&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;useFetch&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;FetchedData&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;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;
&lt;span class="c1"&gt;// ReturnedData&amp;lt;FetchedData&amp;gt; - We pass here data type to our generic&lt;/span&gt;
&lt;span class="c1"&gt;// interface.&lt;/span&gt;
&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nx"&gt;ReturnedData&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;FetchedData&lt;/span&gt;&lt;span class="o"&gt;&amp;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="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;fetchedData&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setFetchedData&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;
    &lt;span class="nx"&gt;ReturnedData&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;FetchedData&lt;/span&gt;&lt;span class="o"&gt;&amp;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="na"&gt;loading&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;useEffect&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fetchData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;void&lt;/span&gt;&lt;span class="o"&gt;&amp;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;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// Static url replaced by dynamic param passed to hook &lt;/span&gt;
        &lt;span class="kd"&gt;const&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;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;axios&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;base&lt;/span&gt;&lt;span class="p"&gt;}${&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="nx"&gt;setFetchedData&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="na"&gt;loading&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;setFetchedData&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
          &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;loading&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Sth went wrong.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;

    &lt;span class="nx"&gt;fetchData&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[]);&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;fetchedData&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;During invoking the hook we should pass a returned data type between &lt;code&gt;&amp;lt;&amp;gt;&lt;/code&gt; syntax like &lt;code&gt;&amp;lt;Users[]&amp;gt;. &lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;const users = useFetch&amp;lt;User[]&amp;gt;("/users")&lt;/code&gt;.&lt;br&gt;&lt;code&gt;const posts = useFetch&amp;lt;Post[]&amp;gt;("/posts")&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Finally, our code is clarified, reusable and well-typed. &lt;/p&gt;

&lt;p&gt;You can review the created code on CodeSandbox.&lt;br&gt;&lt;br&gt;Link here:&lt;br&gt;&lt;a rel="noreferrer noopener" href="https://codesandbox.io/s/dreamy-cloud-oocxq?eslint=1&amp;amp;fontsize=14&amp;amp;hidenavigation=1&amp;amp;theme=dark"&gt;&lt;code&gt;https://codesandbox.io/s/dreamy-cloud-oocxq?eslint=1&amp;amp;fontsize=14&amp;amp;hidenavigation=1&amp;amp;theme=dark&lt;/code&gt;&lt;/a&gt;&lt;a href="https://codesandbox.io/s/dreamy-cloud-oocxq?fontsize=14&amp;amp;hidenavigation=1&amp;amp;theme=dark"&gt;&lt;/a&gt;&lt;a href="https://codesandbox.io/s/dreamy-cloud-oocxq?fontsize=14&amp;amp;hidenavigation=1&amp;amp;theme=dark"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;h2&gt;
&lt;b&gt;Summary&lt;/b&gt;

&lt;/h2&gt;
&lt;p&gt;To sum up, using Generics in Typescript gives you the ability to pass a huge range of types to a component and add an additional abstraction layer to your code which makes it being written with DRY rule. &lt;/p&gt;

&lt;p&gt;Remember that we can apply generics to functions, interfaces and classes in Typescript.&lt;/p&gt;

&lt;p&gt;I hope this example helped you to understand what generics are, how we can use them and why.&lt;/p&gt;

</description>
      <category>react</category>
      <category>typescript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>What Is Strapi And How To Build Your First API?</title>
      <dc:creator>Mariusz</dc:creator>
      <pubDate>Mon, 16 Mar 2020 15:30:43 +0000</pubDate>
      <link>https://dev.to/pagepro_agency/what-is-strapi-and-how-to-build-your-first-api-56jk</link>
      <guid>https://dev.to/pagepro_agency/what-is-strapi-and-how-to-build-your-first-api-56jk</guid>
      <description>&lt;h2&gt;&lt;b&gt;Introduction&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;We can read in an &lt;a href="https://strapi.io/" rel="noreferrer noopener nofollow"&gt;official Strapi website&lt;/a&gt;- “The open-source Headless CMS Front-End Developers love”.&lt;/p&gt;

&lt;p&gt;I wanted to experience this firsthand, so I had to get into Strapi world. In this article, I will share my insights about headless cms’, describe Strapi in detail, and few ways to connect it to any view layer.&lt;/p&gt;

&lt;h2&gt;&lt;b&gt;What is Headless CMS?&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--edFBpEI---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/02/headless.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--edFBpEI---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/02/headless.png" alt="headless statue" class="wp-image-2795"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A headless CMS is a content management system that allows you and members across your organization to manage and write content and access it across all your applications using an API.&lt;/p&gt;

&lt;p&gt;The term “headless” comes from the concept of chopping the “head” (the frontend, i.e. the website) off the “body” (the back end, i.e. the content repository).&lt;/p&gt;

&lt;p&gt;A headless CMS does not care about how and where your content gets displayed. It has only one focus: storing and delivering structured content.&lt;/p&gt;

&lt;h3&gt;&lt;b&gt;Use cases for Headless CMS:&lt;/b&gt;&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Build a website with a technology you are familiar with.&lt;/li&gt;
&lt;li&gt;Websites and Web apps that use JavaScript frameworks (Vue, &lt;a href="https://pagepro.co/react-development.html" rel="noreferrer noopener nofollow"&gt;React&lt;/a&gt;, Angular)&lt;/li&gt;
&lt;li&gt;Websites created with static site generators (&lt;a href="https://pagepro.co/gatsby-development.html" rel="noreferrer noopener nofollow"&gt;Gatsby&lt;/a&gt;, Jekyll, etc.)&lt;/li&gt;
&lt;li&gt;Native Mobile Apps (iOS, Android, Windows Phone, &lt;a href="https://pagepro.co/react-native-development.html" rel="noreferrer noopener nofollow"&gt;React Native&lt;/a&gt; …)&lt;/li&gt;
&lt;li&gt;Enrich product information on e-commerce sites.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;&lt;b&gt;Reasons to adopt a headless CMS solution&lt;/b&gt;&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Freedom from developing the legacy software of tomorrow&lt;/li&gt;
&lt;li&gt;Ability to easily manage content on multiple channels.&lt;/li&gt;
&lt;li&gt;Content management from a single place across the organization.&lt;/li&gt;
&lt;li&gt;Prepared for growth and scalability.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;&lt;b&gt;What is Strapi?&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--L2iEmJv8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/02/logo-strapi-black-blue-1024x286.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--L2iEmJv8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/02/logo-strapi-black-blue-1024x286.png" alt="strapi logo" class="wp-image-2802" width="174" height="48"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Strapi is an open-source headless CMS front-end developers love. It's more than a Node.js Framework and more than a Headless CMS. &lt;/p&gt;

&lt;p&gt;It saves API development time through a beautiful admin panel anyone can use.&lt;/p&gt;

&lt;h3&gt;&lt;b&gt;Strapi most advantages&lt;/b&gt;&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Open source&lt;/strong&gt; - free and open-source, forever. The entire codebase is available on GitHub and is maintained by hundreds of contributors.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Self-hosted&lt;/strong&gt; - security is crucial for companies. Host your data safely, on your own servers. GDPR compliant.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Customizable&lt;/strong&gt; - each project requires specific requirements. Easily customize the admin panel as well as the API.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RESTful or GraphQL&lt;/strong&gt; - consume the API from any client (React, Vue, Angular), mobile apps or even IoT, using REST or GraphQL.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;100% JavaScript&lt;/strong&gt; - one language to rule them all. Use JavaScript everywhere: both for your front-end and your Headless CMS.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Extensible by design&lt;/strong&gt; - plugins system included. Install the auth system, content management, custom plugins, and more, in seconds.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Authentications &amp;amp; Permissions&lt;/strong&gt; - secure your endpoints by allowing or not allowing users to access your API by role.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;&lt;b&gt;Alternatives to Strapi&lt;/b&gt;&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CIdp-q5l--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/02/Screen-Shot-2020-02-28-at-12.04.12-1024x798.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CIdp-q5l--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/02/Screen-Shot-2020-02-28-at-12.04.12-1024x798.png" alt="different coffies on a wooden table" class="wp-image-2798"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are quite a few alternatives to Strapi that you may be already familiar with. &lt;/p&gt;

&lt;p&gt;Most interesting are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a rel="noreferrer noopener nofollow" href="https://wordpress.org/"&gt;Wordpress&lt;/a&gt;: an open-source software to build websites, blogs, and apps.&lt;/li&gt;
&lt;li&gt;
&lt;a rel="noreferrer noopener nofollow" href="https://www.contentful.com/"&gt;Contentful&lt;/a&gt;: a modern platform to manage content in web and mobile apps.&lt;/li&gt;
&lt;li&gt;
&lt;a rel="noreferrer noopener nofollow" href="https://www.netlifycms.org/"&gt;Netlify CMS&lt;/a&gt;: an open-source content management system with support for static site generators. &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://firebase.google.com/" rel="noreferrer noopener nofollow"&gt;Firebase&lt;/a&gt;: cloud service for real-time working apps.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.drupal.org/" rel="noreferrer noopener nofollow"&gt;Drupal&lt;/a&gt;: an open-source content management platform for websites and apps.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;&lt;b&gt;How to create the first API in Strapi&lt;/b&gt;&lt;/h2&gt;

&lt;h3&gt;&lt;b&gt;Small introduction&lt;/b&gt;&lt;/h3&gt;

&lt;p&gt;To build a Strapi application I’ve used  a tool called Docker. &lt;/p&gt;

&lt;p&gt;I found a docker compose file which includes strapi application configuration with postgres database to store data.&lt;/p&gt;

&lt;p&gt;Below you see a code that creates 2 containers - one with strapi app, and the second one with a database container (strapi app is using the database container).&lt;/p&gt;

&lt;p&gt;To build an application and start developing, we only have to be in the directory where we got this docker-compose file and run a docker-compose up command in terminal.&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;3&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="nx"&gt;services&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
 &lt;span class="nx"&gt;strapi&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
   &lt;span class="nx"&gt;container_name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;strapi&lt;/span&gt;
   &lt;span class="nx"&gt;image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;strapi&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;strapi&lt;/span&gt;
   &lt;span class="nx"&gt;environment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
     &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;DATABASE_CLIENT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;postgres&lt;/span&gt;
     &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;DATABASE_HOST&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;db&lt;/span&gt;
     &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;DATABASE_PORT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;5432&lt;/span&gt;
     &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;DATABASE_NAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;strapi&lt;/span&gt;
     &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;DATABASE_USERNAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;strapi&lt;/span&gt;
     &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;DATABASE_PASSWORD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;strapi&lt;/span&gt;
   &lt;span class="nx"&gt;ports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
     &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1337&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;1337&lt;/span&gt;
   &lt;span class="nx"&gt;volumes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
     &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;srv&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;
   &lt;span class="nx"&gt;depends_on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
     &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;db&lt;/span&gt;

 &lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
   &lt;span class="nx"&gt;container_name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;postgres&lt;/span&gt;
   &lt;span class="nx"&gt;image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;postgres&lt;/span&gt;
   &lt;span class="nx"&gt;restart&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;always&lt;/span&gt;
   &lt;span class="nx"&gt;volumes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
     &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="sr"&gt;/lib/&lt;/span&gt;&lt;span class="nx"&gt;postgresql&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;
   &lt;span class="nx"&gt;environment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
     &lt;span class="nx"&gt;POSTGRES_USER&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;strapi&lt;/span&gt;
     &lt;span class="nx"&gt;POSTGRES_PASSWORD&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;strapi&lt;/span&gt;
     &lt;span class="nx"&gt;POSTGRES_DB&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;strapi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;If everything went good, we should see something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--O1Nt_1OM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/Zrzut-ekranu-2020-02-17-o-14.50.33-1024x316.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--O1Nt_1OM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/Zrzut-ekranu-2020-02-17-o-14.50.33-1024x316.png" alt="" class="wp-image-2822"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For the first time you will be seeing a bit more info than you see on screen above, (I run that command already for the second time) so only run database and strapi container. &lt;/p&gt;

&lt;p&gt;To start managing, we should go to http://localhost:1337/admin. Try to put that into your browser.  It’s a &lt;strong&gt;sign up&lt;/strong&gt; page. To start developing we have to create an &lt;strong&gt;admin account&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--E4L7HkzA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/2-1024x520.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--E4L7HkzA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/2-1024x520.png" alt="" class="wp-image-2823"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After successful login, we should be moved to the &lt;strong&gt;dashboard page&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Strapi has a very clear UX design and it is easy to navigate through the whole app. &lt;/p&gt;

&lt;p&gt;There is a &lt;strong&gt;header&lt;/strong&gt; where we can change language and our user settings. On left there is &lt;strong&gt;strapi navigation&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Starting from the top we got &lt;strong&gt;content types&lt;/strong&gt; and our app &lt;strong&gt;models&lt;/strong&gt;. Next to that, we can find plugins with &lt;strong&gt;content type builder&lt;/strong&gt; to create new models. These are the two main things, we are going to use today.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1VM1agVy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1VM1agVy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/3.png" alt="" class="wp-image-2824"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ok, let’s go to the first &lt;strong&gt;content type&lt;/strong&gt; that was automatically created during build strapi app - &lt;strong&gt;Users&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3yfDbo2T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/4-1024x518.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3yfDbo2T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/4-1024x518.png" alt="" class="wp-image-2825"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can see an empty &lt;strong&gt;User&lt;/strong&gt; table but it isn’t truth. &lt;/p&gt;

&lt;p&gt;We have created admin user at the beginning but it doesn’t contain that record. From that view, we can add more users, so try to do that. &lt;/p&gt;

&lt;p&gt;We have to click &lt;strong&gt;Add New User&lt;/strong&gt; button:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PDmjKrPW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/5-1024x520.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PDmjKrPW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/5-1024x520.png" alt="" class="wp-image-2826"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After we click, we are going to create an entry page where we can create a new user record. &lt;/p&gt;

&lt;p&gt;We can see username, email, password string fields and also confirmed and blocked boolean fields. &lt;/p&gt;

&lt;p&gt;On the right side we see roles field which is a relation field. It is a select field with two values: &lt;strong&gt;public&lt;/strong&gt; and &lt;strong&gt;authenticated&lt;/strong&gt;. We will try to add new user, so fill all the fields and click the green &lt;strong&gt;Save&lt;/strong&gt; button.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rN1rg8f5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/6-1024x521.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rN1rg8f5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/6-1024x521.png" alt="" class="wp-image-2827"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We are again on &lt;strong&gt;User&lt;/strong&gt; table page, and we can see the latest added user. &lt;/p&gt;

&lt;p&gt;From that view we can add new records or edit the existing one. It is very easy for non-technical people to manage the application. They don’t have to write the code like developers. Instead, they can create data shapes only by clicking in the dashboard.&lt;/p&gt;

&lt;p&gt;Ok, we have added a new user to the existing content type. &lt;/p&gt;

&lt;p&gt;Let’s create new content type. We can do that by using &lt;strong&gt;Content Type Builder&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5tYSoCrU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/7-1024x520.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5tYSoCrU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/7-1024x520.png" alt="" class="wp-image-2828"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are 3 content types in our app for now. The &lt;strong&gt;User&lt;/strong&gt; content type we saw in navigation menu, and two more - &lt;strong&gt;Permission&lt;/strong&gt; and &lt;strong&gt;Role&lt;/strong&gt; (every strapi app created from the scratch got these content types).&lt;/p&gt;

&lt;p&gt;In this article we won’t go deeper into it. &lt;/p&gt;

&lt;p&gt;Better option will be to create a new model. &lt;/p&gt;

&lt;p&gt;Let’s assume we are creating a headless cms for blog, so we will try to add &lt;strong&gt;Post&lt;/strong&gt; content type. &lt;/p&gt;

&lt;p&gt;By clicking “create new content-type” we move to form:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aK-dIwR3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/8-1024x522.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aK-dIwR3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/8-1024x522.png" alt="" class="wp-image-2829"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can see a modal where we can pick the type of field we want to add to our new model.&lt;/p&gt;

&lt;p&gt;After we choose, for example, text field, the next step is adding the name to that field and choosing more specific text field type - &lt;strong&gt;short text &lt;/strong&gt;or &lt;strong&gt;long text&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Every post got the &lt;strong&gt;title&lt;/strong&gt; and in most cases it is short text. &lt;/p&gt;

&lt;p&gt;So we added this field into our &lt;strong&gt;Post&lt;/strong&gt; model. Next, I have also added &lt;strong&gt;content&lt;/strong&gt; field as a rich text type, &lt;strong&gt;short description&lt;/strong&gt; field as a long text, and &lt;strong&gt;User&lt;/strong&gt; relation field, so any user can have many posts.&lt;/p&gt;

&lt;p&gt;So our &lt;strong&gt;Post&lt;/strong&gt; model looks like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--btBf7m6x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/9-1024x520.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--btBf7m6x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/9-1024x520.png" alt="" class="wp-image-2830"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then we can move to our &lt;strong&gt;Post&lt;/strong&gt; model, which will appear at the top of navigation:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--B0pWTorc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/10.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--B0pWTorc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/10.png" alt="" class="wp-image-2831" width="767" height="390"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the next step we will create an exemplary post that later can be displayed on our blog. Just like in the User model, we should hit the “&lt;strong&gt;Add New Posts&lt;/strong&gt;” button. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Dc_Qq5nP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/11.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Dc_Qq5nP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/11.png" alt="" class="wp-image-2832" width="777" height="397"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have to fill all the fields chosen when we built a post model. &lt;/p&gt;

&lt;p&gt;So, add a post title, content, short description, and select a post’s author. &lt;/p&gt;

&lt;p&gt;After that, let’s save our first post - it will be automatically added to the database. If everything went good, we will see our post on the list.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hHBUqV_U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/12-1024x520.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hHBUqV_U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/12-1024x520.png" alt="" class="wp-image-2833"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If we have any data in our strapi application (post assigned to user), we can use it to be displayed on the frontend - in our case Gatsby blog.&lt;/p&gt;

&lt;p&gt;To make that happen, we need to do one more thing - We have to change permission to models, which we want to get by api. &lt;/p&gt;

&lt;p&gt;In navigation, we should go to roles and permission page. We can see a content with some tabs. We need the first, displayed immediately after we enter the site. Try to edit the authenticated option by clicking on the pencil icon.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CDOMFT7A--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/13-1024x435.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CDOMFT7A--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/13-1024x435.png" alt="" class="wp-image-2834"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After moving to editing section, we can see a form with fields we can edit. &lt;/p&gt;

&lt;p&gt;The one we need is &lt;strong&gt;Permission&lt;/strong&gt; section. We have to allow developers fetch data about posts. &lt;/p&gt;

&lt;p&gt;Mark the find checkbox related to the Post model. After that, save your choice.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--m3VvMl9w--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/14-1024x440.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--m3VvMl9w--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/14-1024x440.png" alt="" class="wp-image-2835"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have to do the same thing for &lt;strong&gt;Public&lt;/strong&gt;. Go to the edit and mark &lt;strong&gt;find&lt;/strong&gt; option related to the Post model.&lt;/p&gt;

&lt;p&gt;This is a basic example done for the article. In real application you have to be careful with permission settings (for example adding create or edit role only for authenticated users).&lt;/p&gt;

&lt;p&gt;So I am creating a common classical Gatsby application, but I won’t be going too much into details, I will only show the things related to fetch our strapi data to gatsby and display it.&lt;/p&gt;

&lt;p&gt;First, we have to add a gatsby plugin, which will magically connect strapi and gatsby together. &lt;/p&gt;

&lt;p&gt;The plugin is called ‘&lt;strong&gt;gatsby-source-strapi&lt;/strong&gt;’. We should use npm or yarn to install it like a normal npm package inside gatsby project directory. &lt;/p&gt;

&lt;p&gt;After that, go to the &lt;strong&gt;gatsby-config.js&lt;/strong&gt; file and add plugin.&lt;/p&gt;

&lt;p&gt;There is a code below:&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="nl"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;gatsby-source-strapi&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="nx"&gt;options&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="nl"&gt;apiURL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;http://localhost:1337&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="nx"&gt;contentTypes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
         &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;post&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="p"&gt;],&lt;/span&gt;
       &lt;span class="nx"&gt;queryLimit&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="p"&gt;},&lt;/span&gt;
   &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;In options you need to add &lt;strong&gt;apiUrl&lt;/strong&gt; (in our case it is http://localhost:1337), and &lt;strong&gt;contentTypes&lt;/strong&gt;. There are models which we want use.&lt;/p&gt;

&lt;p&gt;Run our Gatsby application and try to get data via graphQL. You should go to in-browser IDE and explore data and schema. I have built app on port 8000 so use url: http://localhost:8000/___graphql&lt;/p&gt;

&lt;p&gt;We Need to create query to get posts and fields, that we need to display to all blog users. &lt;/p&gt;

&lt;p&gt;This is an example of query and its response:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CSHZZUtD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/16.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CSHZZUtD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/16.png" alt="" class="wp-image-2836"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s create a basic react components, in this case articles list:&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;graphql&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Link&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;gatsby&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Layout&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../components/layout&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;PostsListStyled&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../components/styles/PostsListStyles&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;BlogPage&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;edges&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;posts&lt;/span&gt; &lt;span class="p"&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="nx"&gt;allStrapiPost&lt;/span&gt;

 &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
   &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Layout&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
     &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;PostsListStyled&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;posts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(({&lt;/span&gt; &lt;span class="na"&gt;node&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;post&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
           &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Link&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;`/blog/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
             &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&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;post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;}:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&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;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;             &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&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;post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;short&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;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;             &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;by&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;username&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;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;           &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Link&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;         &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/li&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;/PostsListStyled&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;   &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Layout&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;BlogPage&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pageQuery&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;graphql&lt;/span&gt;&lt;span class="s2"&gt;`
 query {
   allStrapiPost {
     edges {
       node {
         id
         title
         content
         created_at(formatString: "YYYY-MM-DD")
         user {
           username
         }
         short
       }
     }
   }
 }
`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;If everything went well, after running gatsby blog, we should see a listing. Let’s check it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gv2CUwMr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/17.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gv2CUwMr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/17.png" alt="" class="wp-image-2837"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Everything seems to be working correctly.&lt;/p&gt;

&lt;p&gt;It is exactly the same data we have saved in our strapi cms.&lt;/p&gt;

&lt;p&gt;Next step will be creating an article page. That is an example of basic component page implementation:&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;graphql&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Link&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;gatsby&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Layout&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../components/layout&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Template&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;strapiPost&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;post&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;

 &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
   &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Layout&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
     &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Link&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/blog&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Back&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;list&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Link&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;     &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
       &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&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;post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&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;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;       &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h2&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;post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;created_at&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;/h2&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;       &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h2&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;post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;username&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;/h2&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;       &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;img&lt;/span&gt; &lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;childImageSharp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;original&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;src&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;dangerouslySetInnerHTML&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt; &lt;span class="na"&gt;__html&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;content&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;   &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Layout&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;Template&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;query&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;graphql&lt;/span&gt;&lt;span class="s2"&gt;`
 query ArticleTemplate($id: String!) {
   strapiPost(id: { eq: $id }) {
     title
     content
     created_at(formatString: "YYYY-MM-DD")
     user {
       username
     }
     image {
       childImageSharp {
         original {
           src
         }
       }
     }
   }
 }
`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;One more thing. Making createPages function in gatsby-node file. &lt;/p&gt;

&lt;p&gt;It is necessary to our graphQL query for &lt;strong&gt;Template&lt;/strong&gt; component to work correctly. &lt;/p&gt;

&lt;p&gt;This is the code you have to add to &lt;strong&gt;gatsby-node&lt;/strong&gt;:&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;exports&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;createPages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;actions&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;graphql&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="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;createPage&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;actions&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

 &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getArticles&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;makeRequest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;graphql&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`
   {
     allStrapiPost {
       edges {
         node {
           id
         }
       }
     }
   }
   `&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="c1"&gt;// Create pages for each article.&lt;/span&gt;
   &lt;span class="nx"&gt;result&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;allStrapiPost&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;edges&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(({&lt;/span&gt; &lt;span class="nx"&gt;node&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;createPage&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
       &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`/blog/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="na"&gt;component&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`src/templates/post.js`&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
       &lt;span class="na"&gt;context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
         &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="p"&gt;},&lt;/span&gt;
     &lt;span class="p"&gt;})&lt;/span&gt;
   &lt;span class="p"&gt;})&lt;/span&gt;
 &lt;span class="p"&gt;});&lt;/span&gt;

 &lt;span class="c1"&gt;// Query for articles nodes to use in creating pages.&lt;/span&gt;
 &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;getArticles&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Build Gatsby blog again and check results of our hard work:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--776d_RS4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/18.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--776d_RS4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pagepro.co/blog/wp-content/uploads/2020/03/18.png" alt="" class="wp-image-2838"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;Strapi is a fantastic powerful tool for creating CMS without a head to our applications. &lt;/p&gt;

&lt;p&gt;Headless approach (thanks to the possibility of using data through many applications) makes us free from using one specific technology and enables us to use any of the newest ones.&lt;/p&gt;

&lt;p&gt;We don’t need to know any backend language to write it. We can just click and use it in our business easily.&lt;/p&gt;

&lt;p&gt;It is also a great tool for frontend devs, they can quickly make an API to their frontend applications and use it even to learn new technologies. &lt;/p&gt;

&lt;p&gt;It provides us with a full range of other possibilities. I hope the above article will encourage you to try it out, and start the new adventure with strapi. &lt;/p&gt;

</description>
      <category>webdev</category>
      <category>gatsby</category>
      <category>todayilearned</category>
    </item>
  </channel>
</rss>
