Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
v3ss0n
2y ago
0 comments
Save
Share
This is wrong in so many levels. You need to learn useState,useEffects in react.
You only need to learn how to put {varName} in svelte.
0 comments
5 comments · 2 top-level
top
newest
oldest
scotty79
2y ago
· 2 in thread
You don't need to learn useEffect until you need to plug arbitrary js libs and components into react. That's the intended use of useEffect. Using it for anything else is usually a bad idea.
revskill
2y ago
How can you "fetch something when your state change ?". It's the main use case for useEffect.
scotty79
2y ago
You can just trigger fetch in the function that does the state change.
1 more reply
fomine3
2y ago
· 1 in thread
useState and useEffect are quite simple small elegant API. It does not mean it's very easy to use for newbie. Maybe like Lisp?
pwdisswordfishc
2y ago
Oh sure, useState and useEffect are very simple. Your app built upon them, on the other hand…
j
/
k
navigate · click thread line to collapse