DEV Community

Discussion on: How I moved from React to Svelte

Collapse
 
loktar00 profile image
Jason • Edited

When you use React your bundle is also vanilla js... Also a little confused by the mention of componentDidMount along with the other life cycle methods, that's the class way it's been recommended for years to use hooks.

For styling in react you can scope them the same way using css in js or better yet css modules.

Svelte is definitely a side grade vs an upgrade glad you're getting along well with it.

Collapse
 
kedzior_io profile image
Artur Kędzior

it's been recommended for years to use hooks.
Yep, I would need to update the article and talk about hooks.

For styling in react you can scope them the same way using css in js or better yet css modules.

Same here. Thanks for pointing this out.

Svelte is definitely a side grade vs an upgrade glad you're getting along well with it.

Will share once in production with the big project we are about to go live with. I'm sure it will have its own "gremlins".

Collapse
 
stevetaylor profile image
Steve Taylor

React is still there at runtime. Svelte isn’t. However, I don’t think the difference is nearly as significant as all the other ways Svelte is a big step up from React. Solid, for example, keeps its framework at runtime just as React does, but it also results in small bundles and slightly edges out Svelte in terms of performance, at least in some cases.

Collapse
 
kedzior_io profile image
Artur Kędzior

In most cases performance wise it probably won't matter. In one of my SAAS I found myself in situations where I actually did have performance issues and had guys having years of experience look into it and we had hard time figuring what caused re-rendering. I also got tired of making everything into a component. I know some like it but .....me coming from the backend development I always think of component as shareable piece of code. But hey I understand why it is done like that in React and I followed.

... Solid ...

Yes this is something I looked into next and loved the idea. I tried to use it with Astro.js and Next.js because I thought oh nice I can migrate one of my SAAS (excel like project requiring good perf) done with React + Next.js + mui.com (which is probably one of the best collection of React UI tools out there) without too much effort until I hit the problem with FOAT, so I abandoned it and forgot it completely. I should probably look into it again.

Thread Thread
 
stevetaylor profile image
Steve Taylor

In most cases performance wise it probably won't matter.

For context, I work on smart TV apps. Their browser runtimes can be quite slow, so performance is always front of mind.

Thread Thread
 
kedzior_io profile image
Artur Kędzior

Yeah those are the cases where performance does matter.

TV app would be developed as a native app rather than web app right?

I'm curious, what do you use to build these?