Bro, this issue is with sandbox, it is considering hoisting for const and let as well, try running app using node in your pc/laptop you can see the error.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
It surly works! but my question is "can access lexical declaration `variable' before initialization" in React. 😢
Can you please tell , where you got undefined as output , I mean in your terminal or in the chrome when running app.
I got "undefined" in the chrome console when running react-app.
you could check in my codesandbox
codesandbox.io/s/strange-brook-ii0...
Bro, this issue is with sandbox, it is considering hoisting for const and let as well, try running app using node in your pc/laptop you can see the error.