I want a discussion. I recently switched from a Svelte SPA project to a React one. I have been using React for like 2 years. And this was my first Svelte SPA.
I learnt svelte.dev/tutorial in 4 hours and then immediately jumped on a pretty complex project. Turns out. The learning curve wasn't even there. SFCs made code very visible and I have to worry less and less.
The recent project I am doing in React seems so bad in experience. What are your experiences regarding the same, guys?
non-basic cases are if you have to bring the response data into a global store (i.e. redux), or implement caching, or web sockets or other niche things like that.
This is how Dan Abramov suggests it's done in his article, in which you can observe the fetchData function is defined and invoked inside the useEffect. And the state setter function is called within the fetchData function.
That flavio copes article that theorizable linked to is far too simplistic to help, IMO.
49
u/[deleted] Jun 08 '21
I want a discussion. I recently switched from a Svelte SPA project to a React one. I have been using React for like 2 years. And this was my first Svelte SPA.
I learnt svelte.dev/tutorial in 4 hours and then immediately jumped on a pretty complex project. Turns out. The learning curve wasn't even there. SFCs made code very visible and I have to worry less and less.
The recent project I am doing in React seems so bad in experience. What are your experiences regarding the same, guys?