▲ | slmjkdbtl 16 hours ago | ||||||||||||||||
Based on how they are run they are completely not just ordinary JavaScript functions, hook era components are also not just JavaScript functions, it's a very complicated system. React calling them "just functions" is untrue, just marketing buzz words, and it leads developers into traps. | |||||||||||||||||
▲ | b_e_n_t_o_n 16 hours ago | parent | next [-] | ||||||||||||||||
Many functions can only be called in a certain context. Calling them "not functions" is misleading imo because it implies those functions are compiled out or something, like `$state()` in Svelte. | |||||||||||||||||
| |||||||||||||||||
▲ | Izkata 6 hours ago | parent | prev [-] | ||||||||||||||||
> React calling them "just functions" is untrue I'm pretty sure this is also untrue. AFAIK React has never used that phrase (and at the very least, I can't find it anywhere official right now), it came from other people convincing newcomers that hooks aren't something more complicated like objects (comparing to class-based components). React has always treated them as special functions, hence always prefixing them with the word "use". | |||||||||||||||||
|