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.

1

u/ImpossibleReality903 Jan 09 '22

As nobody is using React.createElement but JSX, React is not running natively as well

What does this mean?

That if I used `React.createElement("Text"` ... or whatever, the views/etc wouldn't be in the JS thread but native? But with JSX it has to be "parsed" then sent to native?

1

u/Only-Split82 Jan 10 '22

I just mean that JSX is not part of vanilla Javascript. So either you use createElement syntax or you need a compilation step to compile JSX to vanilla JS.