Flutter vs React for Web
React and Flutter both are solid technologies backed by some of the largest companies in the world. Both have wide adoption for different purposes though React arguably is more popular for websites and Flutter more popular for building native apps. In this article though we are going to discuss their suitability specifically for web applications and websites that run in browsers.
- What is Flutter ?
- What is React ?
- Advantages of Flutter compared to React
- Disadvantage of Flutter compared to React
- Advantages of React for web compared to Flutter
- Disadvantages of React compared to Flutter
- When should I prefer Flutter over React for web development ?
- When should I prefer React over Flutter for web development ?
Dart itself is a very well designed modern language that supports lot of interesting features such as async methods, null safety, ahead of time compilation, type inference and so on.
Flutter is designed from ground up to be multi platform however over time has found more takers who use it to build iOS and Android apps with a single codebase.
Flutter is a fullfledged framework which means it comes with a huge availabulity of components and libraries which are first class citizens of the framework and you do not have to rely very much on third party libraries to fill the gaps.
Given this, the patterns to design a flutter app remain remarkably well defined and you often don't have to worry about third party libraries to solve any major feature gap.
React became extremely popular library over time and was adopted by many other companies. With time there was a huge ecosystem of third party libraries and frameworks using react.
Unlike Flutter which is a full fledged framework, React is just a library which means React needs to be used with other components if you want a full web application. Examples of such other frameworks are NextJs, MaterialUI for UI components.
React primarily uses a programming language called JSX and there is a typescript version of it called TSX which is gaining traction. But it is common to have multiple languages mixed in a react codebase.
Over time react native was built to provide React like programming paradigm to create native apps for iOS and Android. While React native is also very popular arguably it is less popular than Flutter.
Flutter has many advantages but most of them come from the fact that multi platform support is a first class feature in this framework.
- Build Web, Android and iOS apps with the same codebase.
- Since Flutter is a framework it comes with nearly all libraries you need to build a full functioning app.
- Huge community and active development.
- Several large open source softwares built using Flutter for your reference.
- All the tooling to compile, build, deploy comes with Flutter.
- All the UI components you will need are part of the framework.
- Dart is a very powerful and modern language to power Flutter.
- Whender rendered as Canvas app, flutter web app can do animations and render complex UI components which are extremely hard to do in normal HTML apps.
- Dart language does not have reflection. Not having reflecting is an advantage because of Dart's feature called tree shaking. Dart can know at build time which included libraries are not need ever and simply strip them off from the build.
Flutter is a full framework and most of its disadvantages comes of this fact.
- Flutter is unsuitable for webapps that rely on SEO or have stronger accessibility needs.
- Flutter web apps can be rendered as HTML or Canvas, if you chose Canvas then your website isn't an HTML site anymore. SEO, Web vitals etc. would fail there.
- Flutter is geared towards "app experience" and not a website hence it is unsuitable technology is you are building a website and not an app.
- If you find that exisisting Flutter libraries are not sufficient and you need something else, you will have to put lot of efforts into building it in a cross-platform way.
- The third party plugins are often not meant for all platforms.
- The entire development paradigm is different and hence your existint experience with other technologies is useless.
React is already a big winner in the world of web frontends but I will still provide the advantages.
- Powerful library already widely used.
- Has large active community and ever expanding third party libraries.
- Built for web platform first.
- You can use React with other libraries or legacy codebase without much issues.
- Pages can be built with performance in mind.
- It is possible to do good SEO management for React apps.
- Thinking in react might be slightly hard to learn for someone coming from pure HTML background.
- React performance management is hard if you are inexperienced.
- React is not a framework, you need to chose an appropriate server and UI framework to use React. Though there are many excellent options available.
- Tooling is all over the place. You have wide variety of tools that you have to mix and match to build and compile.
Flutter is a good option when you are building an app and you do not care about search engine indexing, but you care about running it on multiple platforms like Android and iOS. Flutter can also support generating desktop apps for Windows, Linux and MacOS.
There is no reason to use Flutter for web apps if you do not have any need to create cross platform support or if you want the app to be SEO compliant.
Overall, I think Flutter is a good choice only in extreme usecases and in general should be avoided.
In nearly all cases. React is just a library on top of existing web technologies this makes it much better choice for web apps. It is also incredibly popular and has been used by millions of websites and web apps already. It is always better to use a proven technology.
Most comparison articles often end up in ambiguous answers about who is the winner. However when it comes to web, React is a clear winner against Flutter. Not only flutter has a long way to go, it is unlikely it will ever be a better option for web apps because at a fundamental level it is built for cross platform apps and not really open web.
Please email us on firstname.lastname@example.org if you want to cover any specific topic or have any other suggestions.