I really like React and the relatively new hooks structure that makes everything so organized and intuitive, but Svelte is really good! At least for me the learning curve is higher in React, but because Svelte works simmilar to Vanilla JS but adding new features like the other frameworks and with the same optimization as vanilla. I didn't tried Svelte that much to have a solid opinion, but I really hope that JS frameworks start to diversified a bit and see what new frameworks has to offer.
𝙻𝚎𝚊𝚛𝚗 𝚜𝚘𝚖𝚎𝚝𝚑𝚒𝚗𝚐 𝚎𝚟𝚎𝚛𝚢 𝚍𝚊𝚢. JavaScript is my specialty, often playing with Node, React, TypeScript, GraphQL & Ruby on Rails. 5+ years building the web as a Front End Dev.
Location
North Vancouver
Education
Self-taught and always learning
Work
Software Engineer | Building Web 3 with Figment.io
I would still lean towards React for large, complex projects. For now, React is more battle-tested with its adoption and developer community. For example, I started building a modern website in Svelte (that required 3D and AR components) and eventually had to switch back to React because of the libraries that React offers today. Technically, React is also more "reactive" when rendering thousands of components on one page because of the Virtual DOM.
Every developer has its own opinion about what reactivity is for him them.
𝙻𝚎𝚊𝚛𝚗 𝚜𝚘𝚖𝚎𝚝𝚑𝚒𝚗𝚐 𝚎𝚟𝚎𝚛𝚢 𝚍𝚊𝚢. JavaScript is my specialty, often playing with Node, React, TypeScript, GraphQL & Ruby on Rails. 5+ years building the web as a Front End Dev.
Location
North Vancouver
Education
Self-taught and always learning
Work
Software Engineer | Building Web 3 with Figment.io
The first react Hello.js makes no sense why are you storing the jsx in the variable element and not returning it directly also the export can be directly on the function if you would have done that you would see how clean it becomes. Also it is true that svelte is faster on normal apps and site but let's say you are rebuilding excel in the web with thousands of rows then the vdom will update faster.
It is an example of JSX, and you are free to store a component to variables. This example is not to show the cleanest of them, but to show the basic syntax.
Why wouldn't a react developer export it separately? Almost every example I've seen does it that way. And the three companies that I've professionally worked on react code at have done it this way. I find it easier so that you can wrap the export with things like redux or apollo. What an odd thing to say!
I find the code example weird because the svelte code includes css, while the react code does not. Also in the svelte code you explicitly set the var "name" to "world", but then in the react code you pass in a prop named "world"... that's really confusing.
Waiting for the day when Svelte jobs become extremely abundant on job boards.
I really like React and the relatively new hooks structure that makes everything so organized and intuitive, but Svelte is really good! At least for me the learning curve is higher in React, but because Svelte works simmilar to Vanilla JS but adding new features like the other frameworks and with the same optimization as vanilla. I didn't tried Svelte that much to have a solid opinion, but I really hope that JS frameworks start to diversified a bit and see what new frameworks has to offer.
Great break down! Big fan of Svelte. That said...
Totally agree with you! 😃
My bad.
No worries! Thanks for the edit 👍
Svelte is great and all but the job market is filled with React and other top frameworks.
Great comparison. Svelte is amazing for small scale apps; I'm personally not sure how well it would work for large ones.
Svelte every day for me ❤️❤️❤️❤️
Delighted to hear that svelte joined to vercel ( owner of nextjs )... So svelte will cover the market because of this super power
The first react Hello.js makes no sense why are you storing the jsx in the variable element and not returning it directly also the export can be directly on the function if you would have done that you would see how clean it becomes. Also it is true that svelte is faster on normal apps and site but let's say you are rebuilding excel in the web with thousands of rows then the vdom will update faster.
It is an example of JSX, and you are free to store a component to variables. This example is not to show the cleanest of them, but to show the basic syntax.
This is not how a React Developer would write it, it should be written how everyone would and not as ugly as possible.
Special for you: 🙂
Why wouldn't a react developer export it separately? Almost every example I've seen does it that way. And the three companies that I've professionally worked on react code at have done it this way. I find it easier so that you can wrap the export with things like redux or apollo. What an odd thing to say!
I find the code example weird because the svelte code includes css, while the react code does not. Also in the svelte code you explicitly set the var "name" to "world", but then in the react code you pass in a prop named "world"... that's really confusing.
Both Svelte and plain old JS Webcomponents will eventually overtake React unless it changes to keep up.
Svelte. Nothing further to discuss #DeathToReact