01.7 React ref (DOM에 이름 달기)
 
  React.js    01.7 React ref   특정 DOM 요소 에 어떤 작업을 해야 할 때 이렇게 요소에 id를 달면 css에서 특정 id에 특정 스타일을 적용하거나 자바스크립트에서 해당 id를 가진 요소를 찾아서 작업할 수 있다.     <!-- public/index.html 파일 -->  <!DOCTYPE html>  <html  lang= "en" >    <head>      <meta  charset= "utf-8"  />      <link  rel= "shortcut icon"  href= "%PUBLIC_URL%/favicon.ico"  />      <meta        name= "viewport"        content= "width=device-width, initial-scale=1, shrink-to-fit=no"      />      <meta  name= "theme-color"  content= "#000000"  />      <link  rel= "manifest"  href= "%PUBLIC_URL%/manifest.json"  />      <title> React App </title>    </head>    <body>      <noscript> You need to enable JavaScript to run this app. </noscript>      <div  id= "root" ></div>  <!-- id가 root인 div를 확인할 수 있다 -->    </body>  </html...