{"id":25896,"date":"2024-10-27T06:48:22","date_gmt":"2024-10-27T06:48:22","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=25896"},"modified":"2024-11-26T07:51:55","modified_gmt":"2024-11-26T07:51:55","slug":"%eb%a6%ac%ec%95%a1%ed%8a%b8-%ea%b0%95%ec%a2%8c-usereducer-%ec%9d%b4%ed%95%b4%ed%95%98%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/25896\/","title":{"rendered":"\ub9ac\uc561\ud2b8 \uac15\uc88c: useReducer \uc774\ud574\ud558\uae30"},"content":{"rendered":"<p>\n  React\ub294 \uad6c\uc131 \uc694\uc18c\ub97c \uae30\ubc18\uc73c\ub85c \ud55c JavaScript \ub77c\uc774\ube0c\ub7ec\ub9ac\ub85c, \uc0ac\uc6a9\uc790 \uc778\ud130\ud398\uc774\uc2a4(UI) \uad6c\ucd95\uc744 \uc704\ud574 \ub110\ub9ac \uc0ac\uc6a9\ub429\ub2c8\ub2e4. React\uc758 \ub450 \uac00\uc9c0 \uc8fc\uc694 \uc0c1\ud0dc \uad00\ub9ac \ud6c5\uc740 useState\uc640 useReducer\uc785\ub2c8\ub2e4. \uc774\ubc88 \uac15\uc88c\uc5d0\uc11c\ub294 useReducer\uc5d0 \ub300\ud574 \uae4a\uc774 \uc788\uac8c \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4.\n<\/p>\n<h2>1. useReducer\ub780?<\/h2>\n<p>\n  useReducer\ub294 \ub9ac\uc561\ud2b8\uc758 \ub0b4\uc7a5 \ud6c5 \uc911 \ud558\ub098\ub85c, \ubcf5\uc7a1\ud55c \uc0c1\ud0dc \ub85c\uc9c1\uc744 \uad00\ub9ac\ud558\uae30 \uc704\ud574 \uc0ac\uc6a9\ub429\ub2c8\ub2e4. \uc774 \ud6c5\uc740 \uc0c1\ud0dc \ubcc0\ud654\uac00 \uc788\uc744 \ub54c\ub9c8\ub2e4 \ud2b9\uc815\ud55c \ud568\uc218\ub97c \ud638\ucd9c\ud558\uc5ec \uc0c1\ud0dc\ub97c \uc5c5\ub370\uc774\ud2b8\ud569\ub2c8\ub2e4. useState\uac00 \uac04\ub2e8\ud55c \uc0c1\ud0dc \uad00\ub9ac\ub97c \uc704\ud55c \ud6c5\uc774\ub77c\uba74, useReducer\ub294 \ubcf4\ub2e4 \ubcf5\uc7a1\ud55c \ub85c\uc9c1\uc774\ub098 \ub2e4\uc218\uc758 \uc0c1\ud0dc \ubcc0\ud654\ub97c \ud544\uc694\ub85c \ud560 \ub54c \uc801\ud569\ud569\ub2c8\ub2e4.\n<\/p>\n<h2>2. useReducer \uae30\ubcf8 \uc0ac\uc6a9\ubc95<\/h2>\n<p>useReducer\ub97c \uc0ac\uc6a9\ud558\ub294 \uae30\ubcf8\uc801\uc778 \ubc29\ubc95\uc740 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<pre>\n<code>\nimport React, { useReducer } from 'react';\n\nconst initialState = { count: 0 };\n\nfunction reducer(state, action) {\n  switch (action.type) {\n    case 'increment':\n      return { count: state.count + 1 };\n    case 'decrement':\n      return { count: state.count - 1 };\n    default:\n      throw new Error();\n  }\n}\n\nfunction Counter() {\n  const [state, dispatch] = useReducer(reducer, initialState);\n\n  return (\n    &lt;div&gt;\n      &lt;p&gt;Count: {state.count}&lt;\/p&gt;\n      &lt;button onClick={() =&gt; dispatch({ type: 'increment' })}&gt;Increment&lt;\/button&gt;\n      &lt;button onClick={() =&gt; dispatch({ type: 'decrement' })}&gt;Decrement&lt;\/button&gt;\n    &lt;\/div&gt;\n  );\n}\n<\/code>\n<\/pre>\n<p>\n  \uc704\uc758 \uc608\uc81c\uc5d0\uc11c \ubcfc \uc218 \uc788\ub4ef\uc774 useReducer\ub294 \ub450 \uac1c\uc758 \uc778\uc790\ub97c \uc0ac\uc6a9\ud569\ub2c8\ub2e4:<br \/>\n  <strong>reducer \ud568\uc218<\/strong>\uc640 <strong>\ucd08\uae30 \uc0c1\ud0dc(initial state)<\/strong>. reducer \ud568\uc218\ub294 \ud604\uc7ac \uc0c1\ud0dc\uc640 \uc561\uc158\uc744 \ub9e4\uac1c\ubcc0\uc218\ub85c \ubc1b\uc544\uc11c \uc0c8\ub85c\uc6b4 \uc0c1\ud0dc\ub97c \ubc18\ud658\ud569\ub2c8\ub2e4. dispatch \ud568\uc218\ub294 \uc561\uc158 \uac1d\uccb4\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc0c1\ud0dc\ub97c \uc5c5\ub370\uc774\ud2b8\ud569\ub2c8\ub2e4.\n<\/p>\n<h2>3. useReducer\uc758 \uc7a5\uc810<\/h2>\n<ul>\n<li>\n<strong>\ubcf5\uc7a1\ud55c \uc0c1\ud0dc \uad00\ub9ac:<\/strong> useReducer\ub294 \uc5ec\ub7ec \uc0c1\ud0dc\ub97c \uad00\ub9ac\ud558\uae30 \uc704\ud55c \uac15\ub825\ud55c \ub3c4\uad6c\uc785\ub2c8\ub2e4. \uc5ec\ub7ec \uc561\uc158\uacfc \uc0c1\ud0dc\ub97c \uba85\ud655\ud788 \uaddc\uba85\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n  <\/li>\n<li>\n<strong>\ub9ac\ud329\ud1a0\ub9c1\uacfc \ud655\uc7a5\uc131:<\/strong> reducer \ud568\uc218\ub294 \ub3c5\ub9bd\uc801\uc73c\ub85c \uad00\ub9ac\ub418\uae30 \ub54c\ubb38\uc5d0 \uc0c1\ud0dc \ub85c\uc9c1\uc744 \ub9ac\ud329\ud1a0\ub9c1\ud558\uae30\uac00 \uc6a9\uc774\ud569\ub2c8\ub2e4.\n  <\/li>\n<li>\n<strong>\ud14c\uc2a4\ud2b8 \uc6a9\uc774\uc131:<\/strong> reducer \ud568\uc218\ub294 \uc21c\uc218 \ud568\uc218\uc774\uae30 \ub54c\ubb38\uc5d0, \uc774\ub97c \ub2e8\uc704 \ud14c\uc2a4\ud2b8\ud558\uae30\uac00 \uc0c1\ub300\uc801\uc73c\ub85c \uc218\uc6d4\ud569\ub2c8\ub2e4.\n  <\/li>\n<\/ul>\n<h2>4. useReducer\uc640 useState \ube44\uad50<\/h2>\n<p>\n  useState\uc640 useReducer\ub294 \uc0c1\ud0dc\ub97c \uad00\ub9ac\ud558\ub294 \ub370 \ub3c4\uc6c0\uc744 \uc8fc\uc9c0\ub9cc, \uc0ac\uc6a9 \ubaa9\uc801\uc5d0 \ub530\ub77c \uac01\uac01\uc758 \uc801\ud569\ud55c \uc0c1\ud669\uc774 \ub2e4\ub985\ub2c8\ub2e4.\n<\/p>\n<table border=\"1\">\n<thead>\n<tr>\n<th>\ud2b9\uc9d5<\/th>\n<th>useState<\/th>\n<th>useReducer<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\ub2e8\uc21c\ud55c \uc0c1\ud0dc<\/td>\n<td>\uc720\ub9ac<\/td>\n<td>\ubd88\ub9ac<\/td>\n<\/tr>\n<tr>\n<td>\ubcf5\uc7a1\ud55c \uc0c1\ud0dc<\/td>\n<td>\ubd88\ub9ac<\/td>\n<td>\uc720\ub9ac<\/td>\n<\/tr>\n<tr>\n<td>\uc0c1\ud0dc \ubcc0\uacbd \ub85c\uc9c1<\/td>\n<td>\ubd88\ub9ac<\/td>\n<td>\uc720\ub9ac<\/td>\n<\/tr>\n<tr>\n<td>\uc0c1\ud0dc\uc758 \ubd84\ub9ac<\/td>\n<td>\ubd88\ub9ac<\/td>\n<td>\uc720\ub9ac<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>5. \uc2e4\uc804 \uc608\uc81c: ToDo \ub9ac\uc2a4\ud2b8 \uc571 \ub9cc\ub4e4\uae30<\/h2>\n<p>\n  \uc774\uc81c useReducer\ub97c \ud65c\uc6a9\ud558\uc5ec \uac04\ub2e8\ud55c ToDo \ub9ac\uc2a4\ud2b8 \uc571\uc744 \ub9cc\ub4e4\uc5b4 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \uc774 \uc571\uc740 \ud560 \uc77c\uc744 \ucd94\uac00\ud558\uace0, \uc0ad\uc81c\ud560 \uc218 \uc788\ub294 \uae30\ub2a5\uc744 \ud3ec\ud568\ud569\ub2c8\ub2e4.\n<\/p>\n<pre>\n<code>\nimport React, { useReducer } from 'react';\n\nconst initialState = { todos: [] };\n\nfunction reducer(state, action) {\n  switch (action.type) {\n    case 'add':\n      return { ...state, todos: [...state.todos, action.payload] };\n    case 'remove':\n      return { ...state, todos: state.todos.filter((_, index) =&gt; index !== action.payload) };\n    default:\n      throw new Error();\n  }\n}\n\nfunction TodoApp() {\n  const [state, dispatch] = useReducer(reducer, initialState);\n  const [input, setInput] = React.useState('');\n\n  const addTodo = () =&gt; {\n    dispatch({ type: 'add', payload: input });\n    setInput('');\n  };\n\n  return (\n    &lt;div&gt;\n      &lt;h2&gt;ToDo List&lt;\/h2&gt;\n      &lt;input \n        type=\"text\" \n        value={input} \n        onChange={(e) =&gt; setInput(e.target.value)} \n      \/&gt;\n      &lt;button onClick={addTodo}&gt;Add&lt;\/button&gt;\n      &lt;ul&gt;\n        {state.todos.map((todo, index) =&gt; (\n          &lt;li key={index}&gt;\n            {todo} &lt;button onClick={() =&gt; dispatch({ type: 'remove', payload: index })}&gt;Remove&lt;\/button&gt;\n          &lt;\/li&gt;\n        ))}\n      &lt;\/ul&gt;\n    &lt;\/div&gt;\n  );\n}\n<\/code>\n<\/pre>\n<p>\n  \uc704\uc758 TodoApp \ucef4\ud3ec\ub10c\ud2b8\ub294 \uc0ac\uc6a9\uc790\uac00 \ud560 \uc77c\uc744 \ucd94\uac00\ud558\uace0 \uc81c\uac70\ud560 \uc218 \uc788\ub294 \uae30\ub2a5\uc744 \uc81c\uacf5\ud569\ub2c8\ub2e4. useReducer\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc0c1\ud0dc\ub97c \uad00\ub9ac\ud558\uba70, \uac01 \uc561\uc158(type)\ubcc4\ub85c \ud560 \uc77c\uc744 \ucd94\uac00\ud558\uac70\ub098 \uc0ad\uc81c\ud558\ub294 \ub85c\uc9c1\uc744 \uc815\uc758\ud558\uace0 \uc788\uc2b5\ub2c8\ub2e4.\n<\/p>\n<h2>6. useReducer\uc758 \uace0\uae09 \uc0ac\uc6a9\ubc95<\/h2>\n<p>\n  useReducer\ub294 \ub2e8\uc21c\ud55c \uc0c1\ud0dc \uad00\ub9ac\ub97c \ub118\uc5b4\uc11c, \uace0\uae09 \uae30\ub2a5\uc744 \uc9c0\uc6d0\ud569\ub2c8\ub2e4. \ub2e4\uc74c\uc740 \uadf8 \uc77c\ubd80\uc785\ub2c8\ub2e4:\n<\/p>\n<h3>6.1 \ucd08\uae30 \uc0c1\ud0dc \ub85c\ub529<\/h3>\n<p>\n  \ucd08\uae30 \uc0c1\ud0dc\ub97c \ube44\ub3d9\uae30\uc801\uc73c\ub85c \ub85c\ub4dc\ud560 \uc218 \uc788\ub294 \ubc29\ubc95\uc785\ub2c8\ub2e4. \uc774\ub97c \uc704\ud574 useEffect \ud6c5\uc744 \uc0ac\uc6a9\ud569\ub2c8\ub2e4.\n<\/p>\n<pre>\n<code>\nimport React, { useReducer, useEffect } from 'react';\n\nfunction App() {\n  const [state, dispatch] = useReducer(reducer, initialState);\n\n  useEffect(() =&gt; {\n    const fetchData = async () =&gt; {\n      const response = await fetch('\/api\/todos');\n      const data = await response.json();\n      data.forEach(todo =&gt; dispatch({ type: 'add', payload: todo }));\n    };\n    fetchData();\n  }, []);\n\n  \/\/ \ub098\uba38\uc9c0 \uc571 \ucf54\ub4dc...\n}\n<\/code>\n<\/pre>\n<h3>6.2 \uc911\ucca9\ub41c \uc0c1\ud0dc \uad00\ub9ac<\/h3>\n<p>\n  \uc5ec\ub7ec \uac1c\uc758 reducer\ub97c \uc870\ud569\ud558\uc5ec \uad6c\uc870\ud654\ub41c \uc0c1\ud0dc \uad00\ub9ac\ub97c \uc801\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. context API\uc640 \ud568\uaed8 \uc0ac\uc6a9\ud560 \uacbd\uc6b0, \uc804\uc5ed \uc0c1\ud0dc \uad00\ub9ac\ub97c \uc190\uc27d\uac8c \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n<\/p>\n<pre>\n<code>\nfunction mainReducer(state, action) {\n  return {\n    counter: counterReducer(state.counter, action),\n    todos: todoReducer(state.todos, action),\n  };\n}\n\n\/\/ \uc0c1\ud0dc\uc640 dispatch\ub294 \uc5ec\ub7ec \uac1c\uc758 reducer\ub85c \uc81c\uacf5\ub429\ub2c8\ub2e4.\nconst [state, dispatch] = useReducer(mainReducer, initialState);\n<\/code>\n<\/pre>\n<h2>7. \uacb0\ub860<\/h2>\n<p>\n  useReducer\ub294 \ub9ac\uc561\ud2b8\uc5d0\uc11c \ubcf5\uc7a1\ud55c \uc0c1\ud0dc \uad00\ub9ac \ub85c\uc9c1\uc744 \uad6c\ucd95\ud560 \uc218 \uc788\ub294 \uac15\ub825\ud55c \ub3c4\uad6c\uc785\ub2c8\ub2e4. \ud2b9\ud788 \uc5ec\ub7ec \uc0c1\ud0dc \ubcc0\ud654\uac00 \ud544\uc694\ud55c \uacbd\uc6b0, useReducer\ub97c \ud1b5\ud574 \ucf54\ub4dc\uc758 \uac00\ub3c5\uc131\uacfc \uc720\uc9c0\ubcf4\uc218\uc131\uc744 \ub192\uc77c \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc774\ubc88 \uac15\uc88c\uc5d0\uc11c \uc6b0\ub9ac\uac00 \ubc30\uc6b4 \ub0b4\uc6a9\uc744 \ubc14\ud0d5\uc73c\ub85c \uc5ec\ub7ec\ubd84\ub9cc\uc758 \ub9ac\uc561\ud2b8 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c useReducer\ub97c \ud65c\uc6a9\ud574 \ubcf4\uc2dc\uae30 \ubc14\ub78d\ub2c8\ub2e4.\n<\/p>\n<p>\n  \ucd94\uac00\ub85c \uc2e4\uc2b5\ud558\uace0 \uc2f6\uc740 \uc608\uc81c\ub098 \uc9c8\ubb38\uc774 \uc788\ub2e4\uba74 \ub313\uae00\ub85c \ub0a8\uaca8\uc8fc\uc138\uc694. \uc5ec\ub7ec\ubd84\uc758 \ub9ac\uc561\ud2b8 \uac1c\ubc1c \uc5ec\uc815\uc744 \uc751\uc6d0\ud569\ub2c8\ub2e4!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>React\ub294 \uad6c\uc131 \uc694\uc18c\ub97c \uae30\ubc18\uc73c\ub85c \ud55c JavaScript \ub77c\uc774\ube0c\ub7ec\ub9ac\ub85c, \uc0ac\uc6a9\uc790 \uc778\ud130\ud398\uc774\uc2a4(UI) \uad6c\ucd95\uc744 \uc704\ud574 \ub110\ub9ac \uc0ac\uc6a9\ub429\ub2c8\ub2e4. React\uc758 \ub450 \uac00\uc9c0 \uc8fc\uc694 \uc0c1\ud0dc \uad00\ub9ac \ud6c5\uc740 useState\uc640 useReducer\uc785\ub2c8\ub2e4. \uc774\ubc88 \uac15\uc88c\uc5d0\uc11c\ub294 useReducer\uc5d0 \ub300\ud574 \uae4a\uc774 \uc788\uac8c \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. 1. useReducer\ub780? useReducer\ub294 \ub9ac\uc561\ud2b8\uc758 \ub0b4\uc7a5 \ud6c5 \uc911 \ud558\ub098\ub85c, \ubcf5\uc7a1\ud55c \uc0c1\ud0dc \ub85c\uc9c1\uc744 \uad00\ub9ac\ud558\uae30 \uc704\ud574 \uc0ac\uc6a9\ub429\ub2c8\ub2e4. \uc774 \ud6c5\uc740 \uc0c1\ud0dc \ubcc0\ud654\uac00 \uc788\uc744 \ub54c\ub9c8\ub2e4 \ud2b9\uc815\ud55c \ud568\uc218\ub97c \ud638\ucd9c\ud558\uc5ec \uc0c1\ud0dc\ub97c \uc5c5\ub370\uc774\ud2b8\ud569\ub2c8\ub2e4. useState\uac00 &hellip; <a href=\"https:\/\/atmokpo.com\/w\/25896\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;\ub9ac\uc561\ud2b8 \uac15\uc88c: useReducer \uc774\ud574\ud558\uae30&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[20],"tags":[],"class_list":["post-25896","post","type-post","status-publish","format-standard","hentry","category-20"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\ub9ac\uc561\ud2b8 \uac15\uc88c: useReducer \uc774\ud574\ud558\uae30 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/atmokpo.com\/w\/25896\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\ub9ac\uc561\ud2b8 \uac15\uc88c: useReducer \uc774\ud574\ud558\uae30 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"React\ub294 \uad6c\uc131 \uc694\uc18c\ub97c \uae30\ubc18\uc73c\ub85c \ud55c JavaScript \ub77c\uc774\ube0c\ub7ec\ub9ac\ub85c, \uc0ac\uc6a9\uc790 \uc778\ud130\ud398\uc774\uc2a4(UI) \uad6c\ucd95\uc744 \uc704\ud574 \ub110\ub9ac \uc0ac\uc6a9\ub429\ub2c8\ub2e4. React\uc758 \ub450 \uac00\uc9c0 \uc8fc\uc694 \uc0c1\ud0dc \uad00\ub9ac \ud6c5\uc740 useState\uc640 useReducer\uc785\ub2c8\ub2e4. \uc774\ubc88 \uac15\uc88c\uc5d0\uc11c\ub294 useReducer\uc5d0 \ub300\ud574 \uae4a\uc774 \uc788\uac8c \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. 1. useReducer\ub780? useReducer\ub294 \ub9ac\uc561\ud2b8\uc758 \ub0b4\uc7a5 \ud6c5 \uc911 \ud558\ub098\ub85c, \ubcf5\uc7a1\ud55c \uc0c1\ud0dc \ub85c\uc9c1\uc744 \uad00\ub9ac\ud558\uae30 \uc704\ud574 \uc0ac\uc6a9\ub429\ub2c8\ub2e4. \uc774 \ud6c5\uc740 \uc0c1\ud0dc \ubcc0\ud654\uac00 \uc788\uc744 \ub54c\ub9c8\ub2e4 \ud2b9\uc815\ud55c \ud568\uc218\ub97c \ud638\ucd9c\ud558\uc5ec \uc0c1\ud0dc\ub97c \uc5c5\ub370\uc774\ud2b8\ud569\ub2c8\ub2e4. useState\uac00 &hellip; \ub354 \ubcf4\uae30 &quot;\ub9ac\uc561\ud2b8 \uac15\uc88c: useReducer \uc774\ud574\ud558\uae30&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/25896\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-10-27T06:48:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-26T07:51:55+00:00\" \/>\n<meta name=\"author\" content=\"root\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:site\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:label1\" content=\"\uae00\uc4f4\uc774\" \/>\n\t<meta name=\"twitter:data1\" content=\"root\" \/>\n\t<meta name=\"twitter:label2\" content=\"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04\" \/>\n\t<meta name=\"twitter:data2\" content=\"2\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/atmokpo.com\/w\/25896\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/25896\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"\ub9ac\uc561\ud2b8 \uac15\uc88c: useReducer \uc774\ud574\ud558\uae30\",\"datePublished\":\"2024-10-27T06:48:22+00:00\",\"dateModified\":\"2024-11-26T07:51:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/25896\/\"},\"wordCount\":45,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"\ub9ac\uc561\ud2b8 \uae30\ucd08 \uac15\uc88c\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/25896\/\",\"url\":\"https:\/\/atmokpo.com\/w\/25896\/\",\"name\":\"\ub9ac\uc561\ud2b8 \uac15\uc88c: useReducer \uc774\ud574\ud558\uae30 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-10-27T06:48:22+00:00\",\"dateModified\":\"2024-11-26T07:51:55+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/25896\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/25896\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/25896\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\ub9ac\uc561\ud2b8 \uac15\uc88c: useReducer \uc774\ud574\ud558\uae30\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/atmokpo.com\/w\/#website\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/atmokpo.com\/w\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"contentUrl\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"width\":400,\"height\":400,\"caption\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\"},\"image\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/bebubo4\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\",\"name\":\"root\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"caption\":\"root\"},\"sameAs\":[\"http:\/\/atmokpo.com\/w\"],\"url\":\"https:\/\/atmokpo.com\/w\/author\/root\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\ub9ac\uc561\ud2b8 \uac15\uc88c: useReducer \uc774\ud574\ud558\uae30 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/atmokpo.com\/w\/25896\/","og_locale":"ko_KR","og_type":"article","og_title":"\ub9ac\uc561\ud2b8 \uac15\uc88c: useReducer \uc774\ud574\ud558\uae30 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"React\ub294 \uad6c\uc131 \uc694\uc18c\ub97c \uae30\ubc18\uc73c\ub85c \ud55c JavaScript \ub77c\uc774\ube0c\ub7ec\ub9ac\ub85c, \uc0ac\uc6a9\uc790 \uc778\ud130\ud398\uc774\uc2a4(UI) \uad6c\ucd95\uc744 \uc704\ud574 \ub110\ub9ac \uc0ac\uc6a9\ub429\ub2c8\ub2e4. React\uc758 \ub450 \uac00\uc9c0 \uc8fc\uc694 \uc0c1\ud0dc \uad00\ub9ac \ud6c5\uc740 useState\uc640 useReducer\uc785\ub2c8\ub2e4. \uc774\ubc88 \uac15\uc88c\uc5d0\uc11c\ub294 useReducer\uc5d0 \ub300\ud574 \uae4a\uc774 \uc788\uac8c \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. 1. useReducer\ub780? useReducer\ub294 \ub9ac\uc561\ud2b8\uc758 \ub0b4\uc7a5 \ud6c5 \uc911 \ud558\ub098\ub85c, \ubcf5\uc7a1\ud55c \uc0c1\ud0dc \ub85c\uc9c1\uc744 \uad00\ub9ac\ud558\uae30 \uc704\ud574 \uc0ac\uc6a9\ub429\ub2c8\ub2e4. \uc774 \ud6c5\uc740 \uc0c1\ud0dc \ubcc0\ud654\uac00 \uc788\uc744 \ub54c\ub9c8\ub2e4 \ud2b9\uc815\ud55c \ud568\uc218\ub97c \ud638\ucd9c\ud558\uc5ec \uc0c1\ud0dc\ub97c \uc5c5\ub370\uc774\ud2b8\ud569\ub2c8\ub2e4. useState\uac00 &hellip; \ub354 \ubcf4\uae30 \"\ub9ac\uc561\ud2b8 \uac15\uc88c: useReducer \uc774\ud574\ud558\uae30\"","og_url":"https:\/\/atmokpo.com\/w\/25896\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-10-27T06:48:22+00:00","article_modified_time":"2024-11-26T07:51:55+00:00","author":"root","twitter_card":"summary_large_image","twitter_creator":"@bebubo4","twitter_site":"@bebubo4","twitter_misc":{"\uae00\uc4f4\uc774":"root","\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04":"2\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/atmokpo.com\/w\/25896\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/25896\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"\ub9ac\uc561\ud2b8 \uac15\uc88c: useReducer \uc774\ud574\ud558\uae30","datePublished":"2024-10-27T06:48:22+00:00","dateModified":"2024-11-26T07:51:55+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/25896\/"},"wordCount":45,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["\ub9ac\uc561\ud2b8 \uae30\ucd08 \uac15\uc88c"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/25896\/","url":"https:\/\/atmokpo.com\/w\/25896\/","name":"\ub9ac\uc561\ud2b8 \uac15\uc88c: useReducer \uc774\ud574\ud558\uae30 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-10-27T06:48:22+00:00","dateModified":"2024-11-26T07:51:55+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/25896\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/25896\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/25896\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"\ub9ac\uc561\ud2b8 \uac15\uc88c: useReducer \uc774\ud574\ud558\uae30"}]},{"@type":"WebSite","@id":"https:\/\/atmokpo.com\/w\/#website","url":"https:\/\/atmokpo.com\/w\/","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","description":"","publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/atmokpo.com\/w\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/atmokpo.com\/w\/#organization","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","url":"https:\/\/atmokpo.com\/w\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/","url":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","contentUrl":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","width":400,"height":400,"caption":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8"},"image":{"@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/bebubo4"]},{"@type":"Person","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7","name":"root","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","caption":"root"},"sameAs":["http:\/\/atmokpo.com\/w"],"url":"https:\/\/atmokpo.com\/w\/author\/root\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/25896","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/comments?post=25896"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/25896\/revisions"}],"predecessor-version":[{"id":25897,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/25896\/revisions\/25897"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=25896"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=25896"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=25896"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}