Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yeah, that's vanilla syntax. The semantics are fairly magic though. The component function that calls useState though isn't a normal function, it's a function that must be called in a special way by the React runtime in order to line up all of the hidden state that React maintains so that it can magically infer the data that your `useState` call maps to and then there's more magic to maintain the lifetime of that data.


Some of you are really going out of your way to make this more complicated than it is.

Next you're going to complain about the fact that the compiler handles static variables with controlled allocations for you in C.

Like there's no rational basis for your complaints or critique other than grandstanding.


Yes, but it is not syntax. It's a contract with the library. React is completely usable using vanilla JS syntax. Same cannot be said for Vue and Angular. It feels a bit like talking about apples and oranges in this thread.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: