DEV Community

Discussion on: Can somebody help me with React?

Collapse
 
giyeonkwon profile image
Giyeon Kwon

It surly works! but my question is "can access lexical declaration `variable' before initialization" in React. 😢

Collapse
 
siddaiahm profile image
Siddaiah M

Can you please tell , where you got undefined as output , I mean in your terminal or in the chrome when running app.

Thread Thread
 
giyeonkwon profile image
Giyeon Kwon • Edited

I got "undefined" in the chrome console when running react-app.

you could check in my codesandbox
codesandbox.io/s/strange-brook-ii0...

Thread Thread
 
siddaiahm profile image
Siddaiah M

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.