๐Ÿ‘ฉโ€๐Ÿ’ป ๋ฐ˜์‘ JS - ์ดˆ๋ณด์ž์˜ ๋ฒ ์ŠคํŠธ ๊ฐ€์ด๋“œ!(์„น์…˜ 1)

18955 ๋‹จ์–ด reactcareerbeginnersjavascript
React JS๋Š” ํ”„๋ ˆ์ž„์›Œํฌ๊ฐ€ ์•„๋‹Œ ๊ตฌ์„ฑ ์š”์†Œ ๊ธฐ๋ฐ˜ JavaScript ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์ž…๋‹ˆ๋‹ค!์ด๊ฒƒ์€ ๋งค์šฐ ์ค‘์š”ํ•œ ์ •๋ณด์ด๋‹ค. ์™œ๋ƒํ•˜๋ฉด ๋ชจ๋“  ์œ ํ˜•์˜ ๋„์„œ๊ด€์€ ๊ทธ ์žฅ์ ๊ณผ ํ•œ๊ณ„์„ฑ์„ ๊ฐ€์ง€๊ณ  ์žˆ๊ธฐ ๋•Œ๋ฌธ์ด๋‹ค.
์‚ผํ‚ค๊ธฐ ๋ฐ˜์‘ JS ์ฝ”๋“œ๋ฅผ ์ข…๋ฃŒํ•˜๋Š” ๊ฒƒ์€ ๋‹น์‹ ์„ ๋„์™€์ฃผ์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์ค‘์š”ํ•œ ๊ฒƒ์€ ์ด ๊ฑด์˜๋ฅผ ์•Œ๊ณ  ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์—์„œ ์ œ์‹œํ•œ ํ•ด๊ฒฐ ๋ฐฉ์•ˆ์„ ๋ณด๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.
์ด ์‹œ๋ฆฌ์ฆˆ์—์„œ๋Š” JSX๋ฅผ JavaScript๋กœ ์ „์†กํ•˜๋Š” Babel JS๋„ ์„ค์น˜ํ–ˆ์Šต๋‹ˆ๋‹ค.๋ณด์ƒ์œผ๋กœ ๋‹น์‹ ์€ ๋ฐ”๋ฒจ์— ๋Œ€ํ•ด ์ตœ์ข…์ ์œผ๋กœ ์•Œ๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.)
๊ตฌ์„ฑ ์š”์†Œ ๊ธฐ๋ฐ˜ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์™€ ๋งˆ์ฐฌ๊ฐ€์ง€๋กœ ๊ตฌ์„ฑ ์š”์†Œ ๊ฐ„์— ์ •๋ณด๋ฅผ ์ „ํŒŒํ•  ๋•Œ๋„ ํ•œ๊ณ„๊ฐ€ ์žˆ๋‹ค. ๋‹จ๋ฐฉํ–ฅ ๋ฐ์ดํ„ฐ ์—ฐ๊ฒฐ์„ ์‚ฌ์šฉํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์กฐํ•ฉ๊ณผ ์ƒํ•˜๋ฌธ API ๊ธฐ์ˆ  ๋“ฑ ํ•ด๊ฒฐ ๋ฐฉ์•ˆ์„ ๋ณด์•˜๋‹ค.
์šฐ๋ฆฌ๋Š” ๋˜ํ•œ ๊ตฌ์„ฑ ์š”์†Œ์˜ ์ƒํƒœ๋ฅผ ํ† ๋ก ํ–ˆ๋‹ค. ์šฐ๋ฆฌ๋Š” ๊ฐˆ๊ณ ๋ฆฌ ์ƒํƒœ์™€ ์ƒํƒœ๋ฅผ ํ–ฅ์ƒ์‹œํ‚ค๋Š” ๊ธฐ์ˆ ์„ ์‚ฌ์šฉํ–ˆ๋‹ค.๋งˆ์ง€๋ง‰์œผ๋กœ, ๋‚˜๋Š” ๋˜ ๋‹ค๋ฅธ ๊ฐˆ๊ณ ๋ฆฌ๋ฅผ ์‚ฌ์šฉํ–ˆ๋‹ค. useEffect๋Š” ๊ตฌ์„ฑ ์š”์†Œ์˜ ์ƒ๋ช… ์ฃผ๊ธฐ๋ฅผ ๋ณด์—ฌ ์ฃผ์—ˆ๋‹ค.

์ด๊ฒƒ์€ ์•„๋งˆ๋„ ์ดˆ๋ณด์ž์˜ ๊ฐ€์žฅ ์ข‹์€ ๊ฐ•์ขŒ์ผ ๊ฒƒ์ด๋‹ค. ๋‚˜๋Š” ๊ทธ ์ค‘์—์„œ ์†Œ๊ฐœํ•  ๊ฒƒ์ด๋‹ค.

  • ๊ตฌ์„ฑ ์š”์†Œ
  • CDN
  • ๋ถ€ํ„ฐ
  • ์ฒด์ธ ๊ตฌ์„ฑ ์š”์†Œ
  • ๋‹จ๋ฐฉํ–ฅ ๋ฐ์ดํ„ฐ ํ๋ฆ„(๋‹จ๋ฐฉํ–ฅ ๊ท€์†)
  • ์ปจํ…์ŠคํŠธ API
  • Babel JS-Transpiring JSX
  • ์„ฑ๋ถ„
  • ๊ตฌ์„ฑ ์š”์†Œ ์ƒํƒœ - ๋ฐ˜์‘ ์—ฐ๊ฒฐ ์‚ฌ์šฉ:useState
  • ์ƒํƒœ ์ƒ์Šน
  • Hook useEffect๊ฐ€ ์žˆ๋Š” ๊ตฌ์„ฑ ์š”์†Œ ์ˆ˜๋ช…์ฃผ๊ธฐ(๋ฐ์ดํ„ฐ๋ฅผ ๋กœ์ปฌ ์Šคํ† ๋ฆฌ์ง€์— ์ €์žฅํ•˜๋Š” ์˜ˆ์‹œ)
  • ์ด๊ฒƒ์€ ๋ช‡ ๊ฐœ์˜ ๋ฌธ์žฅ์œผ๋กœ ๋‚˜๋ˆŒ ๊ฒƒ์ด๋‹ค. ์ด ๋ฌธ์žฅ์—์„œ ๊ตฌ์„ฑ ์š”์†Œ๊ฐ€ ๋ฌด์—‡์ธ์ง€ ์•Œ๊ฒŒ ๋  ๊ฒƒ์ด๋‹ค. CDN์„ ์‹œ์ž‘์œผ๋กœ ๊ณง ๋‹ค์Œ ๋ฌธ์žฅ์ด ๋‚˜์˜ฌ ๊ฒƒ์ด๋‹ค.

    ๊ตฌ์„ฑ ์š”์†Œ


    ์ž์‹ ์˜ ์ƒํƒœ๋ฅผ ๊ด€๋ฆฌํ•˜๋Š” ํŒจํ‚ค์ง€๋œ ๊ตฌ์„ฑ ์š”์†Œ๋ฅผ ๊ตฌ์ถ•ํ•˜๊ณ  ๋ณต์žกํ•œ UI๋กœ ์กฐํ•ฉํ•ฉ๋‹ˆ๋‹ค.
    ๊ตฌ์„ฑ ์š”์†Œ ๋…ผ๋ฆฌ๋Š” ํ…œํ”Œ๋ฆฟ์ด ์•„๋‹Œ JavaScript๋กœ ์ž‘์„ฑ๋˜๊ธฐ ๋•Œ๋ฌธ์— ์‘์šฉ ํ”„๋กœ๊ทธ๋žจ์„ ํ†ตํ•ด ํ’๋ถ€ํ•œ ๋ฐ์ดํ„ฐ๋ฅผ ์‰ฝ๊ฒŒ ์ „๋‹ฌํ•˜๊ณ  ์ƒํƒœ๋ฅผ DOM์—์„œ ์ œ์™ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

    ๊ฐ„๋‹จํ•œ HTML์„ ๋งŒ๋“ญ๋‹ˆ๋‹ค.
    <!DOCTYPE html>
    <html lang="en">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>React JS - BEST GUIDE for Beginners!</title>
    </head>
    <body>
    
    </body>
    </html>
    
    ๋” ์ž˜ ์ดํ•ดํ•˜๊ธฐ ์œ„ํ•ด์„œ, ์ด ์ƒ‰์ธ์—์„œ ๋ชจ๋“  ์ž‘์—…์„ ์™„์„ฑํ•  ๊ฒƒ์ž…๋‹ˆ๋‹ค.
    <!DOCTYPE html>
    <html lang="en">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>React JS - BEST GUIDE for Beginners!</title>
    </head>
    <body>
    
      <script>
        function MyComponent(){
    
        }
      </script>
    </body>
    </html>
    
    MyComponent ํ•จ์ˆ˜๋Š” ์ด๋ฏธ React์˜ ๊ตฌ์„ฑ ์š”์†Œ์ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

    CDN๋ถ€ํ„ฐ.


    ์ด์ œ React๋ฅผ ์ฃผ์ž…ํ•ด์„œ ๊ฒŒ์ž„์„ ์‹œ์ž‘ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. CDN์„ ์‚ฌ์šฉํ•˜์—ฌ ํ…Œ์ŠคํŠธ๋ฅผ ์ง„ํ–‰ํ•˜์ง€๋งŒ, ๋” ํŠผํŠผํ•œ ํ”„๋กœ๊ทธ๋žจ์„ ๋งŒ๋“ค๋ ค๋ฉด NPM์ด๋‚˜ Yarn๊ณผ ํ•จ๊ป˜ ์„ค์น˜ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
    here๋ฅผ ํด๋ฆญํ•˜์—ฌ ์‹œ์ž‘ ๋งํฌ๋ฅผ ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค.

    ์ƒ‰์ธhtml์€ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ํ•ด์•ผ ํ•œ๋‹ค.
    <!DOCTYPE html>
    <html lang="en">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>React JS - BEST GUIDE for Beginners!</title>
    </head>
    <body>
      <script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
      <script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
    
      <script>
        function MyComponent(){
    
        }
      </script>
    </body>
    </html>
    
    CDN์˜ ์ฒซ ๋ฒˆ์งธ ๋งํฌ๋Š” ์ „์ฒด React, ์ „์ฒด ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ, ๊ฐ€์ƒ DOM, ๊ทธ๋ฆฌ๊ณ  React๋กœ ์ดํ•ดํ•  ์ˆ˜ ์žˆ๋Š” ๋ชจ๋“  ๊ฒƒ์ž…๋‹ˆ๋‹ค.
    ๋‘ ๋ฒˆ์งธ ๋งํฌ๋Š” ํŽ˜์ด์ง€์— React ๊ตฌ์„ฑ ์š”์†Œ๋ฅผ ์ฃผ์ž…ํ•˜๊ฑฐ๋‚˜ ๋ฌธ์ž์—ด์„ ์ƒ์„ฑํ•˜๊ณ  ๋ฐฑ์—”๋“œ๋ฅผ ํ†ตํ•ด ๋ Œ๋”๋งํ•˜๋Š” React DOM์ž…๋‹ˆ๋‹ค.
    ์ด ๊ฒฝ์šฐ ์•ฑ์ด๋ผ๋Š” div์— ์ฃผ์ž…๋ฉ๋‹ˆ๋‹ค.
    <body>
      <div id="app"></div>
      <script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
      <script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
    
      <script>
        function MYComponent(){
    
        }
      </script>
    </body>
    
    ์ด์ œ React๋ฅผ ํ†ตํ•ด ์ƒ์„ฑ๋œ ๋ชจ๋“  ๊ตฌ์„ฑ ์š”์†Œ๊ฐ€ ์ฃผ์ž…๋ฉ๋‹ˆ๋‹ค.
    React DOM์€ ํŽ˜์ด์ง€์— ์ฃผ์ž…๋˜๋Š” ์—ญํ• ์„ ํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๋‘ ๋ฒˆ์งธ CDN ๋งํฌ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ReactDOM์ด๋ผ๋Š” ์ „์—ญ ๋ณ€์ˆ˜๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. ์ด์ œ ๊ทธ ์˜†์— Render ๋ฐฉ๋ฒ•์ด ์žˆ์Šต๋‹ˆ๋‹ค.
    ReactDOM.render()
    
    ์ด๊ฒƒ์€ ๋งค์šฐ ๊ฐ„๋‹จํ•˜๋‹ค. ๊ธฐ๋ณธ์ ์œผ๋กœ ๋„ค๊ฐ€ ์–ด๋–ค ๊ตฌ์„ฑ ์š”์†Œ๋ฅผ ์ฃผ์ž…ํ•˜๊ณ  ์‹ถ์€์ง€, ์–ด๋””์— ์ฃผ์ž…ํ•˜๊ณ  ์‹ถ์€์ง€ ๋งํ•ด๋ผ.
    ์ด ๊ฒฝ์šฐ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ฃผ์ž…ํ•  MyComponent ํ•จ์ˆ˜๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
    <script>
        function MyComponent(){
    
        }
    
        ReactDOM.render(
          MyComponent
        )
      </script>
    
    ๊ทธ๋Ÿฌ๋‚˜ ์•„์ง ์ค€๋น„๊ฐ€ ๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค. MyComponent๋Š” ์ผ๋ฐ˜์ ์ธ JavaScript ํ•จ์ˆ˜์ž…๋‹ˆ๋‹ค. React๋Š” ๊ตฌ์„ฑ ์š”์†Œ์ธ ์ค„ ๋ชฐ๋ž์Šต๋‹ˆ๋‹ค. ์šฐ๋ฆฌ๊ฐ€create Element๋ผ๋Š” React ๋ฐฉ๋ฒ•์„ ์‚ฌ์šฉํ•ด์•ผ ํ•œ๋‹ค๋Š” ๊ฒƒ์„ ์•Œ์•„์•ผ ํ•ฉ๋‹ˆ๋‹ค.
    Create Element๋Š” ์„ธ ๊ฐ€์ง€ ์ฃผ์š” ๋งค๊ฐœ ๋ณ€์ˆ˜๋ฅผ ๋ฐ›์•„๋“ค์ธ๋‹ค. ์ฒซ ๋ฒˆ์งธ๋Š” ๊ตฌ์„ฑ ์š”์†Œ์ด๊ณ , ๋‘ ๋ฒˆ์งธ๋Š” ๋‚ด๊ฐ€ ๊ทธ์—๊ฒŒ ์ „๋‹ฌํ•˜๊ณ  ์‹ถ์€ ์†์„ฑ์ด๋‹ค. ์šฐ๋ฆฌ๋Š” ๋‹ค์Œ์— ํ† ๋ก ํ•  ๊ฒƒ์ด๋‹ค. ์„ธ ๋ฒˆ์งธ๋Š” ์ด ๊ตฌ์„ฑ ์š”์†Œ์˜ ํ•˜์œ„ ์š”์†Œ์ด๋‹ค. ์šฐ๋ฆฌ๋Š” ์ง€๊ธˆ ํ† ๋ก ํ•  ์ƒ๊ฐ์ด ์—†๋‹ค.
    ReactDOM.render(
          React.createElement(MyComponent)
        )
    
    ์ด์ œ ์šฐ๋ฆฌ๋Š” ๋‹ค๋ฅธ ๋งค๊ฐœ ๋ณ€์ˆ˜๋ฅผ ๋ฌด์‹œํ•˜๊ณ  ๊ตฌ์„ฑ ์š”์†Œ๋งŒ ์ „๋‹ฌํ•  ๊ฒƒ์ž…๋‹ˆ๋‹ค.
    ์ด์ œ ์ด ๊ตฌ์„ฑ ์š”์†Œ๊ฐ€ ์–ด๋””๋กœ ์ฃผ์ž…๋ ์ง€ ๋งํ•˜๊ณ  DOM์„ ์กฐ์ž‘ํ•˜๊ธฐ๋งŒ ํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค.
    ReactDOM.render(
            React.createElement(MyComponent),
            document.getElementById("app")
          );
    
    ์šฐ๋ฆฌ๋Š” ์ด ๋ถ€๋ถ„์„ ์™„์„ฑํ–ˆ๋‹ค. ์ง€๊ธˆ๊นŒ์ง€ ์šฐ๋ฆฌ์˜ ์ฝ”๋“œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.
    <!DOCTYPE html>
    <html lang="en">
      <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>React JS - BEST GUIDE for Beginners!</title>
      </head>
      <body>
        <div id="app"></div>
        <script
          crossorigin
          src="https://unpkg.com/react@16/umd/react.development.js"
        ></script>
        <script
          crossorigin
          src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"
        ></script>
    
        <script>
          function MyComponent() {
    
          }
    
          ReactDOM.render(
            React.createElement(MyComponent),
            document.getElementById("app")
          );
        </script>
      </body>
    </html>
    
    ๋ณด์‹œ๋‹ค์‹œํ”ผ ์ €ํฌ ๊ตฌ์„ฑ ์š”์†Œ์ธ MyComponent๋Š” ๋น„์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ํ‘œ์‹œ๋ฅผ ๋งŒ๋“ค๋ ค๋ฉด HTML ํ‘œ์‹œ,div,span ๋“ฑ์ž…๋‹ˆ๋‹ค. React์—์„œ ๋ชจ๋“  ๋‚ด์šฉ์€ ์ด ํ•จ์ˆ˜์ธ React๋กœ ๋งŒ๋“ญ๋‹ˆ๋‹ค.๊ฐ™์€ ๊ตฌ๋ฌธ์„ ๊ฐ€์ง„ createElement.
    ๊ตฌ์„ฑ ์š”์†Œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ƒ์„ฑ๋ฉ๋‹ˆ๋‹ค.
    function MyComponent() {
            return React.createElement("div", null, "Hello world");
          }
    
    ์•ž์—์„œ ๋งํ•œ ๋ฐ”์™€ ๊ฐ™์ด ์„ธ ๊ฐœ์˜ ๋งค๊ฐœ ๋ณ€์ˆ˜๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ์ฒซ ๋ฒˆ์งธ ๋งค๊ฐœ ๋ณ€์ˆ˜์—์„œ ์šฐ๋ฆฌ๋Š” ๋ฌธ์ž์—ด์— HTML ํ‘œ์‹œ๋ฅผ ๋†“์•˜์Šต๋‹ˆ๋‹ค. span, h1์ž…๋‹ˆ๋‹ค. ์ด ์˜ˆ์—์„œ ๋‚˜๋Š”div๋ฅผ ๋†“์•˜๊ณ  ๋‘ ๋ฒˆ์งธ ๋งค๊ฐœ ๋ณ€์ˆ˜์—์„œ ์†์„ฑ์ž…๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด ํด๋ž˜์Šค, id, ์Šคํƒ€์ผ์€ ๋Œ€์ƒ์˜ ๋ชจ๋“  ์†์„ฑ์„ ๋†“์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ์˜ˆ์—์„œnull์„ ๋†“์•˜๊ณ  ์„ธ ๋ฒˆ์งธ ์ด์ƒ์€ ์ด ํ‘œ์‹œ์˜ ํ•˜์œ„ ํ•ญ๋ชฉ์ž…๋‹ˆ๋‹ค. ์ด ์˜ˆ์—์„œ ์ด ํ‘œ์‹œ์˜ ํ•˜์œ„ ํ•ญ๋ชฉ์€ ๋ฌธ์ž์—ด์ž…๋‹ˆ๋‹ค.
    ๋ณด์‹œ๋‹ค์‹œํ”ผ, ๋ชจ๋“  ๊ตฌ์„ฑ ์š”์†Œ๊ฐ€ React ์š”์†Œ๊ฐ€ ์žˆ๋Š” ํ•จ์ˆ˜ ์ถœ๋ ฅ์„ ๋˜๋Œ๋ ค์•ผ ํ•˜๊ธฐ ๋•Œ๋ฌธ์—, ์šฐ๋ฆฌ๋Š” ์‹œ์ž‘๊นŒ์ง€ ๋˜๋Œ๋ ค์ค๋‹ˆ๋‹ค.
    ์ €์žฅํ•  ๋•Œ ์ด div๊ฐ€ React๋ฅผ ํ†ตํ•ด ๋‚˜ํƒ€๋‚˜๋Š” ๊ฒƒ์„ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

    ์›์†Œ๋ฅผ ๊ฒ€์‚ฌํ•˜๋Š”๋ฐ ์šฐ๋ฆฌ ๋ถ€์„œ๊ฐ€ ๊ฑฐ๊ธฐ์— ์žˆ์Šต๋‹ˆ๊นŒ?



    h1๋กœ ์ „ํ™˜


    <script>
          function MyComponent() {
            return React.createElement("h1", null, "Hello world");
          }
    

    React์—์„œ, ๋‹น์‹ ์€ ์˜์›ํžˆ ํ•˜๋‚˜์˜ ๊ตฌ์„ฑ ์š”์†Œ๋งŒ ์žˆ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ์‚ฌ์‹ค์ƒ, ๋ช‡ ๊ฐœ์˜ ๊ตฌ์„ฑ ์š”์†Œ๊ฐ€ ๋‹ค๋ฅธ ๊ตฌ์„ฑ ์š”์†Œ๋ฅผ ํ˜ธ์ถœํ•  ๊ฒƒ์ž…๋‹ˆ๋‹ค. ํ•ญ์ƒ ํ•˜๋‚˜๋Š” ๋ฉ”์ธ ๊ตฌ์„ฑ ์š”์†Œ์ž…๋‹ˆ๋‹ค. ์ด ํŽ˜์ด์ง€๋Š” ๋ชจ๋“  ๋‹ค๋ฅธ ๊ตฌ์„ฑ ์š”์†Œ๋ฅผ ํ˜ธ์ถœํ•ฉ๋‹ˆ๋‹ค.
    ๋ชจ๋“  ์‚ฌ๋žŒ์€ ์•„์ด๊ฐ€ ์žˆ์„ ๊ฒƒ์ด๋‹ค.

    ์ตœ์ข… ์ฝ”๋“œ:
    <!DOCTYPE html>
    <html lang="en">
      <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>React JS - BEST GUIDE for Beginners!</title>
      </head>
      <body>
        <div id="app"></div>
        <script
          crossorigin
          src="https://unpkg.com/react@16/umd/react.development.js"
        ></script>
        <script
          crossorigin
          src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"
        ></script>
    
        <script>
          function MyComponent() {
            return React.createElement("h1", null, "Hello world");
          }
    
          ReactDOM.render(
            React.createElement(MyComponent),
            document.getElementById("app")
          );
        </script>
      </body>
    </html>
    
    ๊ตฌ์„ฑ ์š”์†Œ ๋ถ€๋ถ„์€ ํ˜„์žฌ ์˜จ๋ผ์ธ์ž…๋‹ˆ๋‹ค!๋‹ค์Œ ๋งํฌ๋ฅผ ํด๋ฆญํ•˜๋ฉด ๋‹ค์Œ ํŽ˜์ด์ง€๋ฅผ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ React๊ฐ€ ์ „๋ฐฉ ๊ตฌ์„ฑ ์š”์†Œ์˜ ๊ฐ€์žฅ ์ข‹์€ ํ•ด๊ฒฐ ๋ฐฉ์•ˆ ์ค‘ ํ•˜๋‚˜๋ผ๋Š” ๊ฒƒ์„ ๋ณด์—ฌ ์ค๋‹ˆ๋‹ค.๊ทธ๊ฒƒ์€ ๊ธฐ์ ์„ ์ฐฝ์กฐํ•  ์ˆ˜ ์žˆ๋‹ค.
    ํŠธ์œ„ํ„ฐ์—์„œ ์ €์˜ ์ตœ์‹  ์†Œ์‹์„ ํŒ”๋กœ์šฐํ•˜์„ธ์š”.
    ์‹ ์šฉ:

    ์ข‹์€ ์›นํŽ˜์ด์ง€ ์ฆ๊ฒจ์ฐพ๊ธฐ