r/FlutterDev • • Jan 09 '22

Discussion Can Flutter/Dart replace JavaScript and React? If no, then Why

[removed] — view removed post

43 Upvotes

58 comments sorted by

View all comments

44

u/gaspard-m Jan 09 '22 edited Jan 09 '22

Flutter is still not that mature when it comes to the web. So I do not think that it would be able to replace React in the near future. Furthermore, JavaScript still has the advantage of running natively in a browser while Dart needs « compilation » to JavaScript…

But what is sure is that Flutter is becoming better and better each day that passes and I don’t think the same can be said about React… And if fuschia continues growing, Flutter will start to be way bigger than React. But not replacing it since React also comes with it shares of advantages. Like written in JavaScript which is a very popular language as opposed to dart.

I love Flutter and I am not that experienced with React so my opinion is clearly not impartial ! :)

4

u/Only-Split82 Jan 09 '22

As nobody is using React.createElement but JSX, React is not running natively as well ( the real "native" React interface is too uncomfortable to use it in real apps ). So this is not an advantage over Flutter.

I think the biggest disadvantage of Flutter for Web is that the app runs in canvas instead of using html elements ( please correct me if it is also possible to use html elements in Flutter ). So if it comes to SEO and Browser optimizations it will be worse than the other frameworks. Another disadvantage is debugging as it is imo much more difficult in Flutter Web than in React for example. Maybe it is just that i am used to a certain debugging style that i cant apply to the new technology.

For hybrid mobile apps i think Flutter is much better than the other players. And you can be very productive with it. Super nice technology for this niche.

2

u/qualverse Jan 09 '22

Flutter web uses (by default) a hybrid of canvas and HTML elements to render, although you can also use canvaskit which renders using only canvas. The biggest issue with it though, imo, is the lack of native scrolling.

3

u/Charly_ZA Jan 10 '22

The default auto mode uses the HTML renderer on mobile and the CanvasKit renderer on desktop.

Edit link: https://docs.flutter.dev/development/tools/web-renderers#command-line-options