by ptx · 5y ago · 0 comments
Also, that loading boolean seems unusually variable for a constant.
Like any other constant, it never changes during the lifetime of its scope (a single function invocation) but can be different during different invocations. (The initialization by the useState function, though, is somewhat magical, involving external knowledge of whether this invocation is rendering a new instance or rerendering an existing one.)
loading // true
setLoading(false)
loading // false
they mean that it will become false in the next invocation of the render function, I hope?I see this said a lot, so what's really going on that the class API obfuscates?