|
|
|
After 7 Years of React.js Love,I tried Svelte and I have to admit Its Awesome
|
|
8 points
by anujkosambi
1371 days ago
|
|
* Pros for svelte
- No Virtual-DOM, so zero tension for immutability and no re-rendering chaos
- Svelte inbuilt store is Awesome!, No need to add Redux every time and Svelte store and $ operator are also reactive so data change is good enough for re-rendering component
- There is no hooks, so It is very easy to separate data layer from component. In react if there is business logic in Hooks then often It is hard to access that from pure function or Utils.
- Web Components!!!, If you have to built developing atomic ui-libs, which is became necessary for big projects then Svelte is very good option. Svelte has inbuilt support to export web-components which can run in any browser without any framework and good thing is svelte is just compiler so it is not shipping its own code and Vite will export only necessary code which is required for running web-component unlike react where each library must require react as a dependency.
- ShadowDOM is also good, css-modules are not required
- React.js with nextjs is almost similar as svelte-kit. Nextjs may have better features, but Svelte-kit is also growing. * Cons for Svelte
- If you are not using tailwindcss then you are going to miss passing className prop from parent to child in svelte
- Reactjs has better Community and IDE Support, although my Neovim setup work like charm for Svelte, I still think react will be better for this case |
|