누군가 React로 나를 도울 수 있습니까?
                                            
                                                
                                                
                                                
                                                
                                                
                                                 3807 단어  reactjavascripthelp
                    
//MDN
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Cant_access_lexical_declaration_before_init
import React from "react";
import "./styles.css";
try {
  console.log(test); // undefined
  const test = "THIS IS FOR TEST";
} catch (error) {
  // I don't understand why it doesn't throw the reference error.. 😫
  console.log(error);
}
export default function App() {
  return (
    <div className="App">
      <h1>Hello CodeSandbox</h1>
      <h2>Start editing to see some magic happen!</h2>
    </div>
  );
}
try {
  console.log(test);
  const test = "THIS IS FOR TEST";
} catch (error) {
  console.log(error);
  // ReferenceError: Cannot access 'test' before initialization
    at <anonymous>:2:15
}
Reference
이 문제에 관하여(누군가 React로 나를 도울 수 있습니까?), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/giyeonkwon/can-somebody-help-me-with-react-m4a텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)