<?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>Forem: Filippo Fonseca</title>
    <description>The latest articles on Forem by Filippo Fonseca (@filippofonseca).</description>
    <link>https://forem.com/filippofonseca</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%2F496240%2F2c6eeb06-27ac-4a7f-af3e-7e7c5ede05c9.png</url>
      <title>Forem: Filippo Fonseca</title>
      <link>https://forem.com/filippofonseca</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/filippofonseca"/>
    <language>en</language>
    <item>
      <title>3 Reasons why React is King (&amp; why Flutter will never surpass it)</title>
      <dc:creator>Filippo Fonseca</dc:creator>
      <pubDate>Tue, 14 Jun 2022 01:02:16 +0000</pubDate>
      <link>https://forem.com/filippofonseca/x-reasons-why-react-is-king-why-flutter-will-never-surpass-it-3739</link>
      <guid>https://forem.com/filippofonseca/x-reasons-why-react-is-king-why-flutter-will-never-surpass-it-3739</guid>
      <description>&lt;p&gt;There is a common notion around the development community (especially focused on the React and Flutter communities) that Flutter will eventually "take over" the role of &lt;em&gt;king&lt;/em&gt; of cross-platform (web, mobile, desktop, etc.) development. The following are x reasons why:&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Prevalence &amp;amp; Community
&lt;/h2&gt;

&lt;p&gt;Hundreds of thousands (if not millions) of developers already know and are fluent in React. In addition, companies of the caliber of Tesla, Facebook, Reddit, Salesforce, Tesla, Netflix, WhatsApp, Khan Academy, &amp;amp; more are all powered by React in order to fulfill their software-based initiatives (which many are dependent on for their core business model).&lt;/p&gt;

&lt;p&gt;In short, these companies are all already utilizing React in their day-to-day, and implementing a completely new codebase is simply not a viable option for many internet-based companies. Let me give you an example:&lt;/p&gt;

&lt;p&gt;Take &lt;a href="https://khanacademy.com"&gt;Khan Academy&lt;/a&gt;, for example. Their platform is used by over 100M students, teachers, and parents to expand upon school-based subjects and learning materials with interactive lectures and practices. Could you even imagine the tremendous overhaul, amount of money, and time it would take for it to even become possible (much less feasible) to translate their entire codebase (likely in the hundreds of millions of lines of code) over to something like  Flutter? It's the same intrinsic scenario for others like Tesla, Reddit, Salesforce, WhatsApp, and more. It is simply not a viable option.&lt;/p&gt;

&lt;p&gt;You might be thinking it is not the right approach to base the fact companies will not switch to Flutter on the difficulty and complexity it would take to do so. Think about the following:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Even if companies wanted to migrate to Flutter, they would still struggle with finding the necessary development personnel, infrastructure, resources, and tools in order to do so, as it is well known the community in and around React.js trumps anything that Flutter has managed to acquire over its few short years of existence.  &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  2. Ease of Use &amp;amp; Practicality (Developer Experience)
&lt;/h2&gt;

&lt;p&gt;Let's get technical. The following is an excerpt of Flutter code that uses Dart's built-in type safety (according to the documentation &amp;amp; proper convention) that uses an array of a certain &lt;code&gt;BloodTypes&lt;/code&gt; enum to subsequently handle functionality within class methods:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kt"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;possibleCombinations&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;opos&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;opos&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;opos&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;oneg&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;oneg&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;oneg&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;apos&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;opos&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;apos&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;oneg&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;apos&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;apos&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;apos&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;aneg&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;aneg&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;oneg&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;aneg&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;aneg&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;bpos&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;opos&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;bpos&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;oneg&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;bpos&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;bpos&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;bpos&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;bneg&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;bneg&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;bneg&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;bneg&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;oneg&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;bneg&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;bneg&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;abpos&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;opos&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;abpos&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;apos&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;abpos&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;aneg&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;abpos&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;bpos&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;abpos&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;bneg&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;abpos&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;abpos&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;abpos&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;abneg&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;abneg&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;oneg&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;abneg&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;aneg&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;abneg&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;bneg&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;abneg&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;abneg&lt;/span&gt;&lt;span class="o"&gt;,]&lt;/span&gt;
&lt;span class="o"&gt;]&lt;/span&gt;

&lt;span class="kt"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;generate&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;models&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;[];&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;324&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
      &lt;span class="kt"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;[];&lt;/span&gt;

      &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="kt"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;BloodTypes&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;pair&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;[];&lt;/span&gt;
        &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;r1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Math&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;Random&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;nextInt&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;r2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Math&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;Random&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;nextInt&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;BloodTypes&lt;/span&gt; &lt;span class="n"&gt;donor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;matchNumType&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r1&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;BloodTypes&lt;/span&gt; &lt;span class="n"&gt;patient&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;matchNumType&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r2&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;pair&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;add&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;donor&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;pair&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;add&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;patient&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;add&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pair&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
      &lt;span class="o"&gt;}&lt;/span&gt;

      &lt;span class="n"&gt;models&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;add&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;models&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
  &lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Take a look at how messy that type annotation is: &lt;code&gt;List&amp;lt;List&amp;lt;List&amp;lt;BloodTypes&amp;gt;&amp;gt;&amp;gt;&lt;/code&gt;. Jeez. Not to mention the actual syntax superiority in the actual functionality, although that does come down to personal preference.&lt;/p&gt;

&lt;p&gt;That being said, the following is how the aforementioned type annotation would be represented in TypeScript: &lt;code&gt;BloodTypes[]&lt;/code&gt;. Or hey, if it's JavaScript, no type annotation at all. You've got options with React.&lt;/p&gt;

&lt;p&gt;Ah, simplicity.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. NPM
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/"&gt;&lt;strong&gt;NPM&lt;/strong&gt;&lt;/a&gt; (Node Package Manager) has close to 2M packages in total and 167.6B downloads in the last month alone. Yes, that's billion. Its reach? Unprecedented. Its reliability? Unmatched.&lt;/p&gt;

&lt;p&gt;While Dart's own &lt;a href="https://pub.dev"&gt;&lt;strong&gt;pub.dev&lt;/strong&gt;&lt;/a&gt; has made tremendous advancements in recent years, it simply does not compare to the sheer amount of packages and developers contributing to npm's ever-growing library every day.&lt;/p&gt;

&lt;h2&gt;
  
  
  Concluding Thoughts
&lt;/h2&gt;

&lt;p&gt;There are a myriad other reasons I can think of for why I would say React is superior to Flutter (job availability, integrations with TS, yarn workspaces, cross-platform and web integration w/mobile + desktop, etc.). At the end of the day, it all comes down to personal preference.&lt;/p&gt;

&lt;p&gt;That being said, I have a great amount of respect for Flutter. In no way, shape, or form do I hate the language or Dart, I simply prefer React (from using them both extensively).&lt;/p&gt;

&lt;p&gt;I encourage you to do your own research on the topic and try both React and Flutter out before you jump to any conclusions.&lt;/p&gt;

</description>
      <category>react</category>
      <category>flutter</category>
      <category>reactnative</category>
      <category>npm</category>
    </item>
    <item>
      <title>How to set up a Next.js project with TypeScript and React</title>
      <dc:creator>Filippo Fonseca</dc:creator>
      <pubDate>Mon, 26 Oct 2020 20:08:17 +0000</pubDate>
      <link>https://forem.com/filippofonseca/how-to-set-up-a-next-js-project-with-typescript-and-react-576h</link>
      <guid>https://forem.com/filippofonseca/how-to-set-up-a-next-js-project-with-typescript-and-react-576h</guid>
      <description>&lt;p&gt;&lt;a href="https://nextjs.org"&gt;NextJS&lt;/a&gt; is one of the most important, widely-used, and reliable frameworks for server-side rendering and production with React. This, combined with the ability to integrate TypeScript into your NextJS project makes it all-the-more great to use.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;But how exactly do you go about doing so?&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Initial setup
&lt;/h2&gt;

&lt;p&gt;Before we begin integrating TypeScript into our project, we must first set up our boilerplate Next app with the default JavaScript.&lt;/p&gt;

&lt;h3&gt;
  
  
  Generate the Next app
&lt;/h3&gt;

&lt;p&gt;In order to generate our boilerplate Next starter code, run the following command in your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn create next-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;NOTE: You can always use NPM's &lt;code&gt;npx create-next-app&lt;/code&gt;, but we will be utilizing Yarn over the course of this project and walkthrough.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After you run the initial script, the CLI will prompt you with the following question:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;? What is your project named? &amp;gt;&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;After you type in the name of your project and press &lt;em&gt;Enter&lt;/em&gt;, you'll be good to go! (at least for the basic NextJS setup).&lt;/p&gt;

&lt;p&gt;You can now test that the setup has gone smoothly by running &lt;code&gt;yarn dev&lt;/code&gt; in your command-prompt and opening the port (usually &lt;code&gt;localhost:3000&lt;/code&gt;, on a browser:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd my-app
yarn dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. Create a tsconfig.json file
&lt;/h2&gt;

&lt;p&gt;In order to implement TypeScript into our NextJS project, we must first create. a &lt;code&gt;tsconfig.json&lt;/code&gt; file. Having this file automatically tell NextJS that the root directory is one of a TypeScript project. To put it simply, &lt;em&gt;the presence of a tsconfig.json file in a project indicates that TypeScript is present as well&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;How do we go about creating one? Simply run this command in the root directory of your project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;touch tsconfig.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Install TypeScript &amp;amp; Test Server
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Install dependencies
&lt;/h3&gt;

&lt;p&gt;Install all required dependencies for TypeScript and NextJS by running the following command in your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# If you're using NPM
npm install --save-dev typescript @types/react @types/node

# If you’re using Yarn
yarn add --dev typescript @types/react @types/node
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, pause your server (&lt;code&gt;Ctrl+C&lt;/code&gt;) and start it back up again by using &lt;code&gt;yarn dev&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;As you do so, you will notice that NextJS has automatically detected TypeScript in your project (due to the tsconfig.json file that we created earlier). &lt;/p&gt;

&lt;h2&gt;
  
  
  4. Convert to TypeScript (really simple)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Change the file extensions
&lt;/h3&gt;

&lt;p&gt;Now that TypeScript is properly set up in our project, we can now use it to program our app.&lt;/p&gt;

&lt;p&gt;For starters, I would suggest you convert all existing JavaScript files in the &lt;code&gt;pages&lt;/code&gt; directory of your project into TypeScript (REMEMBER: &lt;code&gt;filename.tsx&lt;/code&gt; for React).&lt;/p&gt;

&lt;p&gt;You are now ready to enjoy the benefits of using TypeScript inside of your NextJS app.&lt;/p&gt;

&lt;p&gt;Happy hacking!&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>typescript</category>
      <category>react</category>
      <category>ssr</category>
    </item>
  </channel>
</rss>
