I appreciate this half rant, half instruction. Some of the workarounds to move to a hooks only react environment really are not all that clean or efficient.
Also just FYI: unless i'm mistaken and there is yet another way to declare functions, your const useConstructor variable is never initialized as a function.
I appreciate this half rant, half instruction. Some of the workarounds to move to a hooks only react environment really are not all that clean or efficient.
Also just FYI: unless i'm mistaken and there is yet another way to declare functions, your const useConstructor variable is never initialized as a function.
In both cases where I illustrated
useConstructor
, it was defined above theApp
function.Yeah it's where you defined it that i don't quite understand and it throws errors for me. "Const declarations' require an initialization value."
Your one has:
Should it not be this? (which works)
I'm not trying to nitpick... i'm just uncertain of my own knowledge and the ever changing landscape of javascript.
Ahhh, yes. Good catch. I am missing the
=>
. Obviously, I didn't actually run these examples. I just typed them out. Thanks!