{"id":66,"date":"2026-06-26T13:32:24","date_gmt":"2026-06-26T13:32:24","guid":{"rendered":"https:\/\/aabbee.cafe24.com\/?p=66"},"modified":"2026-06-26T14:02:47","modified_gmt":"2026-06-26T14:02:47","slug":"%ec%9d%b4%eb%b2%a4%ed%8a%b8-%ec%b2%98%eb%a6%ac","status":"publish","type":"post","link":"https:\/\/coalacoding.com\/?p=66","title":{"rendered":"\uc774\ubca4\ud2b8 \ucc98\ub9ac"},"content":{"rendered":"<h1>1. \uc774\ubca4\ud2b8 \ucc98\ub9ac<\/h1>\n<p>\uc0ac\uc6a9\uc790\uc758 \ud589\ub3d9(\ud074\ub9ad, \uc785\ub825, \ub9c8\uc6b0\uc2a4 \uc774\ub3d9 \ub4f1)\uc5d0 \ubc18\uc751\ud558\ub294 \uc778\ud130\ub799\ud2f0\ube0c\ud55c \uc6f9\uc0ac\uc774\ud2b8\ub97c \ub9cc\ub4e4\uae30 \uc704\ud574 React\uc758 \uc774\ubca4\ud2b8 \uc2dc\uc2a4\ud15c\uc744 \uae4a\uc774 \uc788\uac8c \ud559\uc2b5\ud55c\ub2e4.<\/p>\n<h2>1.1. React \uc774\ubca4\ud2b8 \uc2dc\uc2a4\ud15c \uc774\ud574\ud558\uae30<\/h2>\n<h3>1.1.1. \uc774\ubca4\ud2b8\ub780?<\/h3>\n<p><strong>\uc774\ubca4\ud2b8(Event)<\/strong>\ub294 \uc0ac\uc6a9\uc790\uac00 \uc6f9\ud398\uc774\uc9c0\uc5d0\uc11c \ucde8\ud558\ub294 \ud589\ub3d9\uc744 \uc758\ubbf8\ud55c\ub2e4. \ubc84\ud2bc \ud074\ub9ad, \ud0a4\ubcf4\ub4dc \uc785\ub825, \ub9c8\uc6b0\uc2a4 \uc774\ub3d9 \ub4f1 \ubaa8\ub4e0 \uc0c1\ud638\uc791\uc6a9\uc774 \uc774\ubca4\ud2b8\ub2e4.<\/p>\n<blockquote>\n<p><strong>Tip<\/strong>: <strong>\uc77c\uc0c1 \uc0dd\ud65c\uc758 \ube44\uc720:<\/strong><\/p>\n<p>\u2022 <strong>\ub3c4\uc5b4\ubca8\uc744 \ub204\ub974\uba74(\uc774\ubca4\ud2b8)<\/strong> \u2192 \ucd08\uc778\uc885\uc774 \uc6b8\ub9b0\ub2e4(\ubc18\uc751)<br \/>\n\u2022 <strong>\ub9ac\ubaa8\ucee8 \ubc84\ud2bc\uc744 \ub204\ub974\uba74(\uc774\ubca4\ud2b8)<\/strong> \u2192 TV \ucc44\ub110\uc774 \ubc14\ub010\ub2e4(\ubc18\uc751)<br \/>\n\u2022 <strong>\uc6f9\ud398\uc774\uc9c0\uc5d0\uc11c \ubc84\ud2bc\uc744 \ud074\ub9ad\ud558\uba74(\uc774\ubca4\ud2b8)<\/strong> \u2192 \ubb34\uc5b8\uac00 \uc2e4\ud589\ub41c\ub2e4(\ubc18\uc751)<\/p>\n<p>React\uc5d0\uc11c\ub294 \uc774\ub7f0 &quot;\ubc18\uc751&quot;\uc744 <strong>\uc774\ubca4\ud2b8 \ud578\ub4e4\ub7ec(Event Handler)<\/strong>\ub77c\ub294 \ud568\uc218\ub85c \uc815\uc758\ud55c\ub2e4.<\/p>\n<\/blockquote>\n<h3>1.1.2. HTML vs React \uc774\ubca4\ud2b8 \ube44\uad50<\/h3>\n<table>\n<thead>\n<tr>\n<th align=\"left\">\uad6c\ubd84<\/th>\n<th align=\"left\">HTML<\/th>\n<th align=\"left\">React<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td align=\"left\"><strong>\uc774\ubca4\ud2b8\uba85<\/strong><\/td>\n<td align=\"left\">\uc18c\ubb38\uc790 <code>onclick<\/code><\/td>\n<td align=\"left\">\uce74\uba5c\ucf00\uc774\uc2a4 <code>onClick<\/code><\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><strong>\ud578\ub4e4\ub7ec<\/strong><\/td>\n<td align=\"left\">\ubb38\uc790\uc5f4 <code>&quot;handleClick()&quot;<\/code><\/td>\n<td align=\"left\">\ud568\uc218 <code>{handleClick}<\/code><\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><strong>\uae30\ubcf8 \ub3d9\uc791 \ubc29\uc9c0<\/strong><\/td>\n<td align=\"left\"><code>return false<\/code><\/td>\n<td align=\"left\"><code>e.preventDefault()<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><code class=\"language-jsx\">\/\/ HTML \ubc29\uc2dd\n&lt;button onclick=&quot;handleClick()&quot;&gt;\ud074\ub9ad&lt;\/button&gt;\n\n\/\/ React \ubc29\uc2dd\n&lt;button onClick={handleClick}&gt;\ud074\ub9ad&lt;\/button&gt;\n<\/code><\/pre>\n<blockquote>\n<p><strong>Warning<\/strong>: <strong>\u26a0\ufe0f \uac00\uc7a5 \ud754\ud55c \uc2e4\uc218!<\/strong><\/p>\n<p><code>onClick={handleClick()}<\/code> \u274c \uc798\ubabb\ub428!<br \/>\n<code>onClick={handleClick}<\/code> \u2705 \uc62c\ubc14\ub984!<\/p>\n<p><strong>\uc774\uc720:<\/strong> \uad04\ud638\ub97c \ubd99\uc774\uba74 \ud568\uc218\uac00 \uc989\uc2dc \uc2e4\ud589\ub41c\ub2e4.<\/p>\n<pre><code class=\"language-jsx\">\n<\/code><\/pre>\n<\/blockquote>\n<p>function Button() {<br \/>\n  const handleClick = () =&gt; {<br \/>\n    console.log(&quot;\ud074\ub9ad\ub428&quot;);<br \/>\n  };<\/p>\n<p>  return (<\/p>\n<div>\n      {\/* \u274c \ub80c\ub354\ub9c1 \uc2dc \uc989\uc2dc \uc2e4\ud589 *\/}<br \/>\n      <button onClick={handleClick()}>\uc798\ubabb\ub41c \uc608<\/button><\/p>\n<pre><code>  {\/* \u2705 \ud074\ub9ad \uc2dc\uc5d0\ub9cc \uc2e4\ud589 *\/}\n  &lt;button onClick={handleClick}&gt;\uc62c\ubc14\ub978 \uc608&lt;\/button&gt;\n&lt;\/div&gt;\n<\/code><\/pre>\n<p>  );<br \/>\n}<\/p>\n<pre><code>\n## 1.2. \ud074\ub9ad \uc774\ubca4\ud2b8\n\n### 1.2.1. \uae30\ubcf8 \ud074\ub9ad \uc774\ubca4\ud2b8\n\n```jsx\nfunction ClickExample() {\n  const handleClick = () =&gt; {\n    alert(&quot;\ud074\ub9ad\ub428&quot;);\n  };\n\n  return (\n    &lt;div&gt;\n      &lt;button onClick={handleClick}&gt;\ubc84\ud2bc 1&lt;\/button&gt;\n      &lt;button onClick={() =&gt; alert(&quot;\ubc84\ud2bc 2&quot;)}&gt;\ubc84\ud2bc 2&lt;\/button&gt;\n    &lt;\/div&gt;\n  );\n}\n<\/code><\/pre>\n<h3>1.2.2. \uc778\uc790\uac00 \uc788\ub294 \ud568\uc218 \ud638\ucd9c<\/h3>\n<pre><code class=\"language-jsx\">function ButtonList() {\n  const handleClick = (name) =&gt; {\n    alert(`${name} \ud074\ub9ad\ub428`);\n  };\n\n  return (\n    &lt;div&gt;\n      {\/* \u2705 \uc62c\ubc14\ub984: \ud654\uc0b4\ud45c \ud568\uc218\ub85c \uac10\uc2f8\uae30 *\/}\n      &lt;button onClick={() =&gt; handleClick(&quot;\ube68\uac15&quot;)}&gt;\ube68\uac15&lt;\/button&gt;\n      &lt;button onClick={() =&gt; handleClick(&quot;\ud30c\ub791&quot;)}&gt;\ud30c\ub791&lt;\/button&gt;\n    &lt;\/div&gt;\n  );\n}\n<\/code><\/pre>\n<h2>1.3. \ud3fc \uc774\ubca4\ud2b8<\/h2>\n<h3>1.3.1. onChange \uc774\ubca4\ud2b8<\/h3>\n<pre><code class=\"language-jsx\">function InputExample() {\n  const handleChange = (e) =&gt; {\n    console.log(&quot;\uc785\ub825\uac12:&quot;, e.target.value);\n  };\n\n  return (\n    &lt;div&gt;\n      &lt;input\n        type=&quot;text&quot;\n        onChange={handleChange}\n        placeholder=&quot;\uc785\ub825\ud558\uc138\uc694&quot;\n      \/&gt;\n    &lt;\/div&gt;\n  );\n}\n<\/code><\/pre>\n<h3>1.3.2. onSubmit \uc774\ubca4\ud2b8<\/h3>\n<pre><code class=\"language-jsx\">function FormExample() {\n  const handleSubmit = (e) =&gt; {\n    e.preventDefault(); \/\/ \ud398\uc774\uc9c0 \uc0c8\ub85c\uace0\uce68 \ubc29\uc9c0\n    alert(&quot;\uc81c\ucd9c\ub428&quot;);\n  };\n\n  return (\n    &lt;form onSubmit={handleSubmit}&gt;\n      &lt;input type=&quot;text&quot; name=&quot;username&quot; placeholder=&quot;\uc774\ub984&quot; \/&gt;\n      &lt;button type=&quot;submit&quot;&gt;\uc81c\ucd9c&lt;\/button&gt;\n    &lt;\/form&gt;\n  );\n}\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>1. \uc774\ubca4\ud2b8 \ucc98\ub9ac \uc0ac\uc6a9\uc790\uc758 \ud589\ub3d9(\ud074\ub9ad, \uc785\ub825, \ub9c8\uc6b0\uc2a4 \uc774\ub3d9 \ub4f1)\uc5d0 \ubc18\uc751\ud558\ub294 \uc778\ud130\ub799\ud2f0\ube0c\ud55c \uc6f9\uc0ac\uc774\ud2b8\ub97c \ub9cc\ub4e4\uae30 \uc704\ud574 React\uc758 \uc774\ubca4\ud2b8 \uc2dc\uc2a4\ud15c\uc744 \uae4a\uc774 \uc788\uac8c \ud559\uc2b5\ud55c\ub2e4. 1.1. React \uc774\ubca4\ud2b8 \uc2dc\uc2a4\ud15c \uc774\ud574\ud558\uae30 1.1.1. \uc774\ubca4\ud2b8\ub780? \uc774\ubca4\ud2b8(Event)\ub294 \uc0ac\uc6a9\uc790\uac00 \uc6f9\ud398\uc774\uc9c0\uc5d0\uc11c \ucde8\ud558\ub294 \ud589\ub3d9\uc744 \uc758\ubbf8\ud55c\ub2e4. \ubc84\ud2bc \ud074\ub9ad, \ud0a4\ubcf4\ub4dc \uc785\ub825, \ub9c8\uc6b0\uc2a4 \uc774\ub3d9 \ub4f1 \ubaa8\ub4e0 \uc0c1\ud638\uc791\uc6a9\uc774 \uc774\ubca4\ud2b8\ub2e4. Tip: \uc77c\uc0c1 \uc0dd\ud65c\uc758 \ube44\uc720: \u2022 \ub3c4\uc5b4\ubca8\uc744 \ub204\ub974\uba74(\uc774\ubca4\ud2b8) \u2192 \ucd08\uc778\uc885\uc774 \uc6b8\ub9b0\ub2e4(\ubc18\uc751) \u2022 \ub9ac\ubaa8\ucee8 &#8230; <a title=\"\uc774\ubca4\ud2b8 \ucc98\ub9ac\" class=\"read-more\" href=\"https:\/\/coalacoding.com\/?p=66\" aria-label=\"\uc774\ubca4\ud2b8 \ucc98\ub9ac\uc5d0 \ub300\ud574 \ub354 \uc790\uc138\ud788 \uc54c\uc544\ubcf4\uc138\uc694\">\ub354 \uc77d\uae30<\/a><\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-66","post","type-post","status-publish","format-standard","hentry","category-react-basics"],"_links":{"self":[{"href":"https:\/\/coalacoding.com\/index.php?rest_route=\/wp\/v2\/posts\/66","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/coalacoding.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/coalacoding.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/coalacoding.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=66"}],"version-history":[{"count":1,"href":"https:\/\/coalacoding.com\/index.php?rest_route=\/wp\/v2\/posts\/66\/revisions"}],"predecessor-version":[{"id":2248,"href":"https:\/\/coalacoding.com\/index.php?rest_route=\/wp\/v2\/posts\/66\/revisions\/2248"}],"wp:attachment":[{"href":"https:\/\/coalacoding.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=66"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/coalacoding.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=66"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/coalacoding.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=66"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}