{"id":184,"date":"2021-12-31T01:10:14","date_gmt":"2021-12-31T01:10:14","guid":{"rendered":"https:\/\/techwyns.com\/tech\/?p=184"},"modified":"2021-12-31T01:10:56","modified_gmt":"2021-12-31T01:10:56","slug":"flutter-vs-react-native","status":"publish","type":"post","link":"https:\/\/techwyns.com\/tech\/blog\/2021\/12\/31\/flutter-vs-react-native\/","title":{"rendered":"Flutter vs React Native"},"content":{"rendered":"<p>One of the main tasks I fulfill as TechWyns CTO is assessing the technical and cultural fit of new employees. My involvement normally begins at the final stages of our hiring process, where I can do my part in making sure TechWyns always hires the best candidates. But, beyond that, I\u2019ve also found these moments are a great opportunity to learn more about the insights and interests of many different developers.<\/p>\n<p>For example, most of my recent conversations with top cross-platform mobile developers have had one thing in common: an increasing level of excitement for Flutter when compared to React Native. Since\u00a0<a href=\"https:\/\/www.fullstacklabs.co\/projects\/react-native\" target=\"_blank\" rel=\"noopener\">React Native is one of the main technologies<\/a>\u00a0we use here at FSL, I got curious and started doing some research on the \u201cflutter vs react native\u201d dilemma. Naturally, I had to write an article about it, so let\u2019s start with some of the basic concepts.<\/p>\n<h2>What Is Flutter?<\/h2>\n<p><a href=\"https:\/\/flutter.dev\/\" target=\"_blank\" rel=\"noopener\">Flutter<\/a>\u00a0is an open-source mobile UI framework designed to help developers create native applications for mobile, web, and desktop using only one codebase. It was created and officially released by Google in 2018, and it\u2019s arguably just starting to become a mature technology in the mobile development industry. From what I\u2019ve seen, there are two things that make Flutter stand out to mobile developers:<\/p>\n<ul role=\"list\">\n<li><strong>The Flutter SDK<\/strong>: Flutter\u2019s Software Development Kit goes beyond the standard collection of tools used to develop mobile apps and includes some incredible tools to compile code into native code for iOS and Android.<\/li>\n<li><strong>The Widget Library<\/strong>: As a framework for mobile development, Flutter comes with an amazing UI library that\u2019s based on reusable widgets. This way, developers can easily personalize UI elements (a.k.a., buttons, form fields, sliders, etc) according to their needs and the needs of the project.<\/li>\n<li><strong>Plugin Ecosystem<\/strong>: Flutter ships with an amazing plugin ecosystem that opens up a lot of possibilities for developers. Thanks to this, integrating features GPS location, Animated UI Controls, and SQLite management is faster and easier.<\/li>\n<\/ul>\n<p>Another aspect that makes Flutter unique is the programming language behind it: Dart. Dart was announced by Google back in 2011 at a GOTO conference in Denmark, where it was presented as an object-oriented, class-based, garbage-collected programming language with C-style syntax that could compile to native code or JavaScript. However, the beta wasn\u2019t released until two years later and it initially received a mixed reception by the mobile development community.<\/p>\n<p>Since then, Dart has certainly improved a lot and the growing popularity of Flutter is proof of it. Today, Dart is seen as a very powerful programming language, and Flutter developers especially appreciate its support for inheritance, interfaces, and asynchronous programming. In fact, I believe most people would agree that the grand majority of mobile developers (and even\u00a0<a href=\"https:\/\/www.fullstacklabs.co\/react-native-developers\" target=\"_blank\" rel=\"noopener\">React Native developers<\/a>) are choosing to learn Dart because of Flutter. If you\u2019re interested, here\u2019s what a\u00a0<strong><em>Hello World<\/em><\/strong>\u00a0app looks like using Dart and Flutter:<\/p>\n<div class=\"w-embed\">\n<pre class=\" language-dart\"><code class=\" keep-markup language-dart\">\r\n<span class=\"token keyword\">import<\/span> <span class=\"token string\">'package:flutter\/material.dart'<\/span><span class=\"token punctuation\">;<\/span>\r\n\r\n<span class=\"token keyword\">void<\/span> <span class=\"token function\">main<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">=<\/span><span class=\"token operator\">&gt;<\/span> <span class=\"token function\">runApp<\/span><span class=\"token punctuation\">(<\/span><span class=\"token function\">MyApp<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\r\n\r\n<span class=\"token keyword\">class<\/span> <span class=\"token class-name\">MyApp<\/span> <span class=\"token keyword\">extends<\/span> <span class=\"token class-name\">StatelessWidget<\/span> <span class=\"token punctuation\">{<\/span>\r\n  <span class=\"token metadata symbol\">@override<\/span>\r\n  Widget <span class=\"token function\">build<\/span><span class=\"token punctuation\">(<\/span>BuildContext context<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span>\r\n    <span class=\"token keyword\">return<\/span> <span class=\"token function\">MaterialApp<\/span><span class=\"token punctuation\">(<\/span>\r\n      title<span class=\"token punctuation\">:<\/span> <span class=\"token string\">'Welcome to Flutter'<\/span><span class=\"token punctuation\">,<\/span>\r\n      home<span class=\"token punctuation\">:<\/span> <span class=\"token function\">Scaffold<\/span><span class=\"token punctuation\">(<\/span>\r\n        appBar<span class=\"token punctuation\">:<\/span> <span class=\"token function\">AppBar<\/span><span class=\"token punctuation\">(<\/span>\r\n          title<span class=\"token punctuation\">:<\/span> <span class=\"token function\">Text<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">'Welcome to Flutter'<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span>\r\n        <span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span>\r\n        body<span class=\"token punctuation\">:<\/span> <span class=\"token function\">Center<\/span><span class=\"token punctuation\">(<\/span>\r\n          child<span class=\"token punctuation\">:<\/span> <span class=\"token function\">Text<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">'Hello World'<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span>\r\n        <span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span>\r\n      <span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span>\r\n    <span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\r\n  <span class=\"token punctuation\">}<\/span>\r\n<span class=\"token punctuation\">}<\/span>\r\n\t<\/code><\/pre>\n<\/div>\n<p>Finally, we can\u2019t really talk about Flutter without talking about its widget-based system. The idea behind Flutter is to combine different widgets that provide developers with everything they would need to build an entire UI. As I briefly mentioned before, these widgets can be used to define almost any type of UI element, including structural (buttons, menus), stylistic (fonts, colors), layouts (padding, sizes), and many other types of elements.<\/p>\n<p>Keep in mind that Flutter uses its own ready-made and native-looking widgets for this and it never uses OEM widgets, as some of the new people learning Flutter might think. Developers can also create their own custom widgets and use reactive-style views that compile Dart ahead of time into native code for multi-platform apps.<\/p>\n<p>There\u2019s a lot more to say about Flutter, but I feel this is enough to give you a rough idea of it. We can take a better look at it when we start comparing it to React Native, so let\u2019s move on.<\/p>\n<h2>What Is React Native?<\/h2>\n<p>React Native is a JavaScript framework that allows rapid development of native applications. Just like Flutter, React Native is open-source and created by a tech giant, Facebook. Since its release in 2015, React Native has been commonly used for building native applications in all kinds of platforms, including Android, Android TV, iOS, macOS, Windows, and Web. Here are a few reasons why React Native has been so successful in native development:<\/p>\n<ul role=\"list\">\n<li><strong>Platform Agnostic Components<\/strong>: React Native allows developers to create truly native apps by providing a series of platform-agnostic native components that map directly to the platform\u2019s UI building blocks. In fact, this is one of the main reasons why\u00a0<a href=\"https:\/\/www.fullstacklabs.co\/blog\/coinbases-mobile-app-built-react-native\" target=\"_blank\" rel=\"noopener\">Coinbase built its mobile app 100% with React Native<\/a>.<\/li>\n<li><strong>Declarative UI Paradigm<\/strong>: React Native components are designed to wrap existing native code and interact with native APIs following a declarative UI paradigm. Along with Fast Refresh (which is React Native\u2019s implementation of \u201cSave, See, Repeat\u201d iterations),\u00a0 that makes collaboration between developers a whole lot easier and facilitates a seamless cross-platform development experience.<\/li>\n<li><strong>Built On Top of React<\/strong>: As the name implies, React Native is built on top of React, the popular JavaScript library used by countless developers to create interactive web applications. The reliability, flexibility, and evident love from the community for this technology eased the transition towards React Native for a lot of developers.<\/li>\n<\/ul>\n<p>In essence, the working principles of React Native are almost identical to the ones of React. However, note that React Native does not manipulate the virtual DOM, and instead runs background processes directly on the native platform. Also, React Native does not use HTML or CSS. As\u00a0<a href=\"https:\/\/mashable.com\/2012\/09\/11\/html5-biggest-mistake\/\" target=\"_blank\" rel=\"noopener\">Mark Zuckerberg famously said<\/a>\u00a0in 2012, HTML was never the path towards true native experiences.<\/p>\n<p>To solve the markup language problem, React Native uses a mixture of JavaScript, JSX, and a special markup code known as JXL, which is considerably resemblant to XML. This way, React Native gains the ability to communicate with both JavaScript-based threads and Native app threads. In the spirit of making a quick comparison with the Flutter syntax, here\u2019s what a\u00a0<strong><em>Hello World<\/em><\/strong>\u00a0app looks like in React Native:<\/p>\n<div class=\"w-embed\">\n<pre class=\" language-js\"><code class=\" keep-markup language-js\">\r\n<span class=\"token keyword\">import<\/span> React <span class=\"token keyword\">from<\/span> <span class=\"token string\">'react'<\/span><span class=\"token punctuation\">;<\/span>\r\n<span class=\"token keyword\">import<\/span> <span class=\"token punctuation\">{<\/span> Text<span class=\"token punctuation\">,<\/span> View <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">from<\/span> <span class=\"token string\">'react-native'<\/span><span class=\"token punctuation\">;<\/span>\r\n\r\n<span class=\"token keyword\">const<\/span> <span class=\"token function-variable function\">HelloWorldApp<\/span> <span class=\"token operator\">=<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">=&gt;<\/span> <span class=\"token punctuation\">{<\/span>\r\n  <span class=\"token keyword\">return<\/span> <span class=\"token punctuation\">(<\/span>\r\n    <span class=\"token operator\">&lt;<\/span>View style<span class=\"token operator\">=<\/span><span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">{<\/span>\r\n        flex<span class=\"token operator\">:<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">,<\/span>\r\n        justifyContent<span class=\"token operator\">:<\/span> <span class=\"token string\">'center'<\/span><span class=\"token punctuation\">,<\/span>\r\n        alignItems<span class=\"token operator\">:<\/span> <span class=\"token string\">'center'<\/span>\r\n      <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">}<\/span><span class=\"token operator\">&gt;<\/span>\r\n      <span class=\"token operator\">&lt;<\/span>Text<span class=\"token operator\">&gt;<\/span>Hello<span class=\"token punctuation\">,<\/span> world<span class=\"token operator\">!<\/span><span class=\"token operator\">&lt;<\/span><span class=\"token operator\">\/<\/span>Text<span class=\"token operator\">&gt;<\/span>\r\n    <span class=\"token operator\">&lt;<\/span><span class=\"token operator\">\/<\/span>View<span class=\"token operator\">&gt;<\/span>\r\n  <span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\r\n<span class=\"token punctuation\">}<\/span>\r\n\r\n<span class=\"token keyword\">export<\/span> <span class=\"token keyword\">default<\/span> HelloWorldApp<span class=\"token punctuation\">;<\/span>\r\n\t<\/code><\/pre>\n<\/div>\n<p>In 2018, React Native had the\u00a0<a href=\"https:\/\/octoverse.github.com\/2018\/projects#repositories\" target=\"_blank\" rel=\"noopener\">2nd highest<\/a>\u00a0number of contributors out of all repositories in GitHub and it remains one of the top ones to this day. Their community is as strong as it has ever been, and thousands of big-name companies have already rewritten their apps with React Native. Some of the most notable ones are Coinbase, Shopify,\u00a0 Uber, Erikson, Facebook, Instagram, Pinterest, Discord, SoundCloud, and Skype.<\/p>\n<p>React Native has stood out as a unique cross-platform development solution because of its incredible code reusability, rapid cross-platform development, a large development community, and native-level performance. With all of that said, let\u2019s move on to the actual comparison of Flutter vs React Native in 2021.<\/p>\n<h2>The Popularity Matchup<\/h2>\n<p>To start anecdotally, nearly all of the developers I have talked to or heard discussing cross-platform mobile technologies have been more excited about Flutter than React Native over the last year. This correlates with the data in Stack Overflow Trends, which shows that Flutter overtook React Native sometime in 2019. Since then, React Native has leveled out and Flutter is holding an upward trajectory.<\/p>\n<figure class=\"w-richtext-align-fullwidth w-richtext-figure-type-image\">\n<div><img decoding=\"async\" src=\"https:\/\/assets-global.website-files.com\/5d9bc5d562ffc22c37470958\/60ad78b4602e59247b4cd3c7_7EXLoH8czwpQ0sWV5R_1pAe_2G94t-tYUT4brYnUo7Kasgw1C0Ky8GE8riqjghJMwS4XJiAJGBhcSLvpNggl6SycFDX6sCt5RZUtiy0F1AbPStN5KqVLkIdN0v7y2efOMFbCyMvX.png\" alt=\"flutter vs react native stack overflow trends\" \/><\/div><figcaption>Source:\u00a0<a href=\"https:\/\/insights.stackoverflow.com\/trends?tags=flutter%2Creact-native\">Stack Overflow Trends<\/a><\/figcaption><\/figure>\n<p>But the correlation doesn\u2019t stop there. Several other sites show that, when comparing the best cross-platform mobile app development technologies, Flutter is consistently trending up while React Native holds or slightly declines. For example:<\/p>\n<ul role=\"list\">\n<li>A quick look at\u00a0<a href=\"https:\/\/insights.stackoverflow.com\/trends?tags=flutter%2Creact-native\" target=\"_blank\" rel=\"noopener\">Google Trends<\/a>\u00a0shows that Flutter also surpassed React Native in early 2019, and currently React Native is on a slight decline after reaching peak interest a few months ago.<\/li>\n<li>In terms of GitHub contributions, the React Native vs Flutter dilemma is clear.\u00a0<a href=\"https:\/\/github.com\/flutter\/flutter\" target=\"_blank\" rel=\"noopener\">Flutter<\/a>\u00a0has consistently maintained higher numbers and, at the moment, it appears to be trending up whereas the opposite is true for\u00a0<a href=\"https:\/\/github.com\/facebook\/react-native\" target=\"_blank\" rel=\"noopener\">React Native<\/a>.<\/li>\n<li>Finally, GitHub Pulse activity shows that Flutter has been far more active over the past month in every metric.<\/li>\n<\/ul>\n<figure class=\"w-richtext-align-fullwidth w-richtext-figure-type-image\"><\/figure>\n<p>All of this data comes to show what you\u2019ve probably realized already: Flutter is getting comfortably ahead of React Native. However, with only 13 thousand apps using Flutter at the moment (in comparison to\u00a0<a href=\"https:\/\/twitter.com\/mfpiccolo\/status\/1382008291279142913\/photo\/1\" target=\"_blank\" rel=\"noopener\">React Native\u2019s 31 thousand<\/a>), React Native still has a significant dominance in mobile stores and we have yet to see how many more companies will ultimately choose Flutter for their upcoming projects.<\/p>\n<h2>Comparing React Native and Flutter<\/h2>\n<p>Now that we know quite a bit about React Native and Flutter, we can start comparing them in more specific categories. For this, I thought it would be best to focus on a few major categories and select a relative winner for each.\u00a0The Programming Language: Dart vs JavaScript<\/p>\n<p>Comparing Dart vs JavaScript is a massive topic that would probably take us a whole series of articles to tackle properly, especially because this isn\u2019t an apples-to-apples comparison\u2014Dart is designed to compile to JavaScript and native code. So take this quick comparison with a grain of salt.<\/p>\n<ul role=\"list\">\n<li><strong>Maturity<\/strong>: JS has been around for a lot longer, so it is clearly the more mature and stable language. Even though the Google devs have put a lot of work into making Dart easy to use, it is still relatively new to programmers and there\u2019s not a lot of learning resources compared to JS. So point for\u00a0<strong><em>JavaScript +1<\/em><\/strong>.<\/li>\n<li><strong>Popularity<\/strong>: I spent a lot of time in this article arguing the growing popularity of Flutter and the stagnant growth curve of React Native. However, in terms of programming language popularity, JavaScript wins by a landslide. JavaScript is simply everywhere and it\u2019s a must for virtually every single mobile development project out there.\u00a0<strong><em>JavaScript +1<\/em><\/strong>.<\/li>\n<li><strong>Productivity<\/strong>: This is a complex one. On one hand, JS has a lot more libraries and available resources thanks to its massive community and long-time market presence. On the other hand, Dart is a newer, more optimized, and purposefully designed language for cross-platform development. Since we\u2019re mainly talking about mobile development productivity here, I\u2019ve got to give this one to\u00a0<strong><em>Dart +1<\/em><\/strong>.<\/li>\n<li><strong>Speed<\/strong>: As an interpreted language, JavaScript is well-known for being lighter and faster for native development than compiled languages like Java. However,\u00a0<a href=\"https:\/\/benchmarksgame-team.pages.debian.net\/benchmarksgame\/fastest\/dart.html\" target=\"_blank\" rel=\"noopener\">recent benchmarks\u00a0<\/a>put Dart ahead of JavaScript. This is attributed to the fact that Dart can be compiled both ahead of time and just in time, which are great speed boosts in Flutter development. While results may vary, the general consensus shows Dart has higher chances of being faster, so\u00a0<strong><em>Dart +1<\/em><\/strong>.<\/li>\n<li><strong>Flexibility<\/strong>: Both Dart and JavaScript can be used for web and mobile application development. However, Dart is rarely used for web development and JavaScript offers so many choices in this field that\u2019s literally not fair to compare the two. In mobile development, Dart uses Flutter to focus on widget-based development, which is arguably a lot less flexible than what JS frameworks and libraries can bring to the table, so this one has got to go to\u00a0<strong><em>JavaScript +1<\/em><\/strong>.<\/li>\n<\/ul>\n<p>It seems like React Native takes this round. Let\u2019s move on.<\/p>\n<h3>The Underlying Architecture<\/h3>\n<p>According to the official\u00a0<a href=\"https:\/\/flutter.dev\/docs\/resources\/architectural-overview\" target=\"_blank\" rel=\"noopener\">Flutter documentation<\/a>, Flutter\u2019s architecture is designed as a layered, extensible system. In other words, it exists as a series of independent libraries that always depend on their underlying layers. No layer has privileged access to the layer below it, and every part of the framework level is designed to be optional and replaceable.<\/p>\n<p>At the core of Flutter is the Flutter Engine, which is written in C++ and supports all the flutter primitives. Developers normally interact with Flutter through the Flutter Framework, which is the modern, reactive Dart framework we\u2019re used to seeing. At this level, we can find the foundational classes, the rendering layer, the widgets layer, and the Material and Cupertino libraries. For further information, please refer to the documentation linked above.<\/p>\n<p>React Native\u2019s architecture is Flux, the application architecture that Facebook uses for building client-side web applications. It is based on the concept of Unidirectional Data Flow, and made of four individual components:<\/p>\n<ul role=\"list\">\n<li>Actions, which are helper methods that facilitate parsons data to the dispatcher.<\/li>\n<li>Dispatcher, which receives actions and broadcasts payloads to registered callbacks.<\/li>\n<li>Stores, which are containers for the application state and logic and which store all of the callbacks registered to the dispatcher.<\/li>\n<li>Controlled Views, which are React Components that grab the state from Stores and pass it down via props to child components.<\/li>\n<\/ul>\n<p>The Dispatcher is perhaps the most important component of the bunch. It differs from generic pub-sub systems in two ways: first, callbacks are not subscribed to particular events and, second, every payload is dispatched to every registered callback. Along with Node.js\u2019s EventEmitter, Flux will use the Dispatcher to set up an event system that makes it easier to manage the application state. Further information can be found in their\u00a0<a href=\"https:\/\/github.com\/facebook\/flux\/tree\/master\/examples\" target=\"_blank\" rel=\"noopener\">GitHub documentation<\/a>.<\/p>\n<p>With all of that said, determining who wins this round is a bit pointless from a general perspective. Both React Native and Flutter have great underlying architectures\u2014otherwise, they wouldn&#8217;t be as popular as they are. Choosing one or the other based on their architecture is mostly dependent on the particular requirements of the application, so I\u2019ll leave this score to you.<\/p>\n<h3>The Performance Race<\/h3>\n<p>When it comes to performance, Flutter takes a very different approach than React Native or even native development. In essence, the fact that the Flutter framework is compiled using ARM C++ allows it to get as close to machine code as possible and, consequently, allows for better performance in most scenarios. React Native, in contrast, compiles its UI components into their native equivalents, runs JS on a separate thread, and communicates directly with native modules using bridges to ensure all needed actions are fulfilled.<\/p>\n<p>This means that Flutter\u2019s widget-based system makes it a great option for performance-optimized applications that need to use as little CPU and memory as possible. React Native, on the other hand, often needs additional components to achieve UX targets, which naturally reduces performance just slightly enough to be considerable. All of this is illustrated with several examples on\u00a0<a href=\"https:\/\/benchmarksgame-team.pages.debian.net\/benchmarksgame\/fastest\/dart.html\" target=\"_blank\" rel=\"noopener\">this benchmark<\/a>.<\/p>\n<p>Additionally, the Google team just released Flutter 2, which now supports Progressive Web Application (PWA) development using the same code base as mobile projects. Flutter 2 also provides support for high-performance 2D and 3D APIs and hardware acceleration, and companies like iRobot and Rive have recently released performance-driven web and mobile applications that leverage these features.<\/p>\n<p>Based on this information, I believe that Flutter is better for performance-driven applications, so we\u2019ve got to give it this round. However, there\u2019s a lot that goes into measuring performance, so your mileage may vary.<\/p>\n<h3>Testing with React Native and Flutter<\/h3>\n<p>When the time comes for testing, most React Native applications use Jest, a JavaScript test runner maintained by Facebook. Since version 0.38, a Jest setup is included by default when running\u00a0<strong><em>react-native init<\/em><\/strong>\u00a0and automatically adds the necessary configuration to the\u00a0<strong><em>package.json<\/em><\/strong>\u00a0file. This also creates a\u00a0<strong><em>jest.preset<\/em><\/strong>\u00a0node environment that mimics the environment of the React Native app, and avoids loading any DOM or browser APIs to improve startup time.<\/p>\n<p>Still, since many React Native and third-party components rely on native code to be rendered, Jest is forced to include a manual mocking system that can help to mock out the underlying implementation. Common third-party components like video can easily be mocked, often with just a few lines of code, but more complex manual mocks are required for forwarding prop types or static fields.<\/p>\n<p>For component and integration testing, React Native developers often use React\u2019s Test Renderer and the React Native Testing Library. However, at this level the testing frameworks are only running JavaScript tests in a Node.js environment, so they do not take into account any iOS, Android, or other platform code which is backing the React Native components.<\/p>\n<p>In Flutter development, unit testing is fairly simple, as developers only need to test Dart classes using the\u00a0<strong><em>dart<\/em><\/strong>\u00a0package. Then comes widget testing, which is analogous to component testing. Testing a widget involves multiple classes and requires a test environment that provides the appropriate widget lifecycle context, but everything is included in the\u00a0<strong><em>flutter_test<\/em><\/strong>\u00a0package, which ships with the Flutter SDK. These are the tools included:<\/p>\n<ul role=\"list\">\n<li>The\u00a0<strong><em>WidgetTester<\/em><\/strong>\u00a0allows building and interacting with widgets in a test environment.<\/li>\n<li>The\u00a0<strong><em>testWidgets()<\/em><\/strong>\u00a0function automatically creates a new\u00a0<strong><em>WidgetTester<\/em><\/strong>\u00a0for each test case, and is used in place of the normal\u00a0<strong><em>test()<\/em><\/strong>\u00a0function.<\/li>\n<li>The\u00a0<strong><em>Finder<\/em><\/strong>\u00a0classes allow searching for widgets in the test environment.<\/li>\n<li>Widget-specific\u00a0<strong><em>Matcher<\/em><\/strong>\u00a0constants help verify whether a\u00a0<strong><em>Finder<\/em><\/strong>\u00a0locates a widget or multiple widgets in the test environment.<\/li>\n<\/ul>\n<p>Arguably, the widget testing tools provided by Flutter make testing an easier and faster job than testing in React Native. So we\u2019ve got to give this one to Flutter.<\/p>\n<h3>Development Speed<\/h3>\n<p>Since they are designed for cross-platform development, both React Native and Flutter are great for development speed and can reduce traditional project delivery time by up to 50%. They also both have their own implementation of \u201cSave, See, Repeat\u201d iterations (Fast Refresh for React and Hot Reload for Flutter), and they both work extremely well. However, the final development time will always depend on two things: the knowledge of the development team in the technology and how many developers you can actually hire.<\/p>\n<p>React Native has clearly been around longer, and the market dominance of React and JavaScript has motivated countless developers to learn and apply this library in their native development projects. After all, learning and implementing the native version of a library you already love is not a hard decision.<\/p>\n<p>In contrast, Flutter hasn\u2019t had as much time to attract as many mobile developers, even if it\u2019s significantly trendier right now than React Native. This means that there aren\u2019t as many developers with a lot of seniority in Flutter development, and it might be a bit harder to find the right people for the job.<\/p>\n<p>Taking all of this into account, development speed is likely to be higher in React Native development projects. However, Flutter does provide many different IDE integrations that can really speed up development. Even on VIM, Flutter allows developers to use tools like IntelliSense, autocompletion, and validation. None of that is available on React Native unless you use TypeScript and the package supports types. So, in terms of potential, Flutter could be the faster development technology.<\/p>\n<h3>Community and Ecosystem<\/h3>\n<p>Popularity aside, both React Native and Flutter have amazing communities of developers behind them. And, contrary to what you may believe after reading the popularity section of this article, the numbers are fairly close. Here\u2019s a quick glance at some relevant community stats for each technology:<\/p>\n<div class=\"w-embed\">\n<table>\n<tbody>\n<tr>\n<td><strong>Metric<\/strong><\/td>\n<td><strong>React Native<\/strong><\/td>\n<td><strong>Flutter<\/strong><\/td>\n<\/tr>\n<tr>\n<td>First stable release<\/td>\n<td>March 2015<\/td>\n<td>April 2018<\/td>\n<\/tr>\n<tr>\n<td>GitHub stars<\/td>\n<td>95.3k<\/td>\n<td>120k<\/td>\n<\/tr>\n<tr>\n<td>StackOverflow questions<\/td>\n<td>99.2k<\/td>\n<td>86.9k<\/td>\n<\/tr>\n<tr>\n<td>StackOverflow unanswered questions<\/td>\n<td>26.1k<\/td>\n<td>20.1k<\/td>\n<\/tr>\n<tr>\n<td>Reddit community<\/td>\n<td>75.1k<\/td>\n<td>70.3k<\/td>\n<\/tr>\n<tr>\n<td>Twitter community<\/td>\n<td>110k<\/td>\n<td>141k<\/td>\n<\/tr>\n<tr>\n<td>Facebook community<\/td>\n<td>45.4k<\/td>\n<td>61.7k<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>As of the publication date of this article, the numbers in these tables show that the React Native and Flutter communities are very similar in size. However, Flutter has had three fewer years to build its community, so I find it quite amazing that it has managed to surpass React Native by significant margins in some of these metrics. With Flutter, it\u2019s all been about its accelerated growth curve, as shown by this graph.<\/p>\n<figure class=\"w-richtext-align-fullwidth w-richtext-figure-type-image\">\n<div><img decoding=\"async\" src=\"https:\/\/assets-global.website-files.com\/5d9bc5d562ffc22c37470958\/60ad780939bdb8426a17a1fb_R2Ttc2RUnfCqP-7I671Bg2ysQLqahVBjWRuTvARAUDa40puv_zXipGWNk888yntFxIbbtlDh2S_KBEyQ1atOGm7PumEITxJM2kW--UH83EO3S3MWMHqTCa7f7J-IYOR5CaDaGH-o.png\" alt=\"React Native and Flutter GitHub Star History\" \/><\/div><figcaption>Source:\u00a0<a href=\"https:\/\/star-history.t9t.io\/#flutter\/flutter&amp;facebook\/react-native\" target=\"_blank\" rel=\"noopener\">Star history<\/a><\/figcaption><\/figure>\n<p>Beyond that, I think it is also valuable to take a look at some of the major apps using these technologies. On one side, some popular React Native apps are Facebook, Tesla, Bloomberg, Instagram, Coinbase, and Uber (we actually know a little bit about this last one, since TechWyns worked on a\u00a0<a href=\"https:\/\/www.fullstacklabs.co\/#work\" target=\"_blank\" rel=\"noopener\">React Native project with Uber<\/a>). On the other side, some popular Flutter projects are Google Assistant, Alibaba, BMW, Square, eBay, and Capital One.<\/p>\n<p>There\u2019s still one major difference to point out here, though\u2014and that\u2019s how the ecosystems of both these technologies compare. As the more mature technology, the React Native ecosystem is more stable and has a lot more packages available. That\u2019s why it\u2019s still the preferred cross-platform development technology for larger projects. Flutter, on the other hand, can\u2019t be saved by its trendiness and is definitely not as mature as React Native. They just\u00a0<a href=\"https:\/\/medium.com\/flutter\/flutter-web-support-hits-the-stable-milestone-d6b84e83b425\" target=\"_blank\" rel=\"noopener\">recently hit the stable milestone<\/a>\u00a0for their web version last March, and, unlike React Native, they still maintain\u00a0<a href=\"https:\/\/flutter.dev\/docs\/development\/tools\/sdk\/releases\" target=\"_blank\" rel=\"noopener\">beta versions<\/a>\u00a0of the software on their official site.<\/p>\n<p>With all of that into play, I\u2019ve got to give this one to React Native. Flutter comes very close and it will probably reach the \u201cmature technology\u201d category sooner than expected, but until then, it seems like React Native\u2019s older and more stable community is the winner of this category.<\/p>\n<h2>Final React Native vs Flutter Comparative Table<\/h2>\n<p>Before finishing up, let\u2019s take a look at all that we\u2019ve learned in a comparative table.<\/p>\n<div class=\"w-embed\">\n<table>\n<tbody>\n<tr>\n<td><strong>Matchup<\/strong><\/td>\n<td><strong>React Native<\/strong><\/td>\n<td><strong>Flutter<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Language<\/td>\n<td>JavaScript<\/td>\n<td>Dart<\/td>\n<\/tr>\n<tr>\n<td>Creator<\/td>\n<td>Facebook<\/td>\n<td>Google<\/td>\n<\/tr>\n<tr>\n<td>Release date<\/td>\n<td>2015<\/td>\n<td>2018<\/td>\n<\/tr>\n<tr>\n<td>Popularity<\/td>\n<td>Large, but stagnant<\/td>\n<td>Large and trending upward<\/td>\n<\/tr>\n<tr>\n<td>Resources<\/td>\n<td>Large, inclusive library with a lot of adaptive components<\/td>\n<td>Smaller, non-inclusive and widget-based libraries<\/td>\n<\/tr>\n<tr>\n<td>Learning curve<\/td>\n<td>Easy, especially if you already know JS and React<\/td>\n<td>Steeper, requires Dart and reactive programming<\/td>\n<\/tr>\n<tr>\n<td>Architecture<\/td>\n<td>Flux<\/td>\n<td>Layered (Framework, Engine, Embedder)<\/td>\n<\/tr>\n<tr>\n<td>Community<\/td>\n<td>Mature and resourceful<\/td>\n<td>Younger, but fast-growing<\/td>\n<\/tr>\n<tr>\n<td>Platform support<\/td>\n<td>Android, Android TV, iOS, macOS, Windows, and Web<\/td>\n<td>Android, iOS, and Web<\/td>\n<\/tr>\n<tr>\n<td>Popular apps<\/td>\n<td>Facebook, Tesla, Bloomberg, Instagram, Coinbase, Uber<\/td>\n<td>Google Assistant, Alibaba, BMW, Square, eBay, Capital One<\/td>\n<\/tr>\n<tr>\n<td>Talent pool<\/td>\n<td>More senior developers thanks to React and JavaScript\u2019s popularity<\/td>\n<td>Fewer developers due to Dart\u2019s uncommon use historically<\/td>\n<\/tr>\n<tr>\n<td>Development Workflow<\/td>\n<td>Component-based development following JavaScript standards.<\/td>\n<td>Widget-based development using Dart.<\/td>\n<\/tr>\n<tr>\n<td>Stability<\/td>\n<td>Highly stable as a mature technology<\/td>\n<td>Less stable and manages an Alpha and Beta version<\/td>\n<\/tr>\n<tr>\n<td>Testing<\/td>\n<td>Often requires third-party tools for proper testing.<\/td>\n<td>Provides all the tools needed for testing.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h2>Closing Thoughts<\/h2>\n<p>Comparing React Native and Flutter in this article has been particularly difficult, but I hope that the information here can help you in some way or another. After all of this, I do agree with all of the developers I\u2019ve talked to: Flutter is certainly a very interesting technology with a lot of potential, and I can see it growing more throughout the rest of the year.<\/p>\n<p>Nonetheless, I still believe React Native has a place in cross-platform development and that\u2019s not going to change anytime soon. The fact that it\u2019s easier to find senior React Native developers than senior Flutter developers means that most large projects will probably still choose React Native in the near future. Maybe in a year (or less) Flutter will finally reach that \u201cmaturity\u201d point and be easier to trust for tech leaders.<\/p>\n<p>For now, I think it\u2019s very exciting that so many people are jumping into the Flutter bandwagon and as CTO of TechWyns, I\u2019m also looking forward to working on more Flutter projects with my team. React Native and Flutter are both amazing technologies and I am certain that the future of mobile and cross-platform development lies in them.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the main tasks I fulfill as TechWyns CTO is assessing the technical and cultural fit of new employees. My involvement normally begins at the final stages of our hiring process, where I can do my part in making sure TechWyns always hires the best candidates. But, beyond that, I\u2019ve also found these moments [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"pagelayer_contact_templates":[],"_pagelayer_content":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-184","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/techwyns.com\/tech\/wp-json\/wp\/v2\/posts\/184","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techwyns.com\/tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techwyns.com\/tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techwyns.com\/tech\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techwyns.com\/tech\/wp-json\/wp\/v2\/comments?post=184"}],"version-history":[{"count":2,"href":"https:\/\/techwyns.com\/tech\/wp-json\/wp\/v2\/posts\/184\/revisions"}],"predecessor-version":[{"id":186,"href":"https:\/\/techwyns.com\/tech\/wp-json\/wp\/v2\/posts\/184\/revisions\/186"}],"wp:attachment":[{"href":"https:\/\/techwyns.com\/tech\/wp-json\/wp\/v2\/media?parent=184"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techwyns.com\/tech\/wp-json\/wp\/v2\/categories?post=184"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techwyns.com\/tech\/wp-json\/wp\/v2\/tags?post=184"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}