{"id":39095,"date":"2024-11-02T02:36:57","date_gmt":"2024-11-02T02:36:57","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=39095"},"modified":"2024-11-26T06:42:27","modified_gmt":"2024-11-26T06:42:27","slug":"%ed%9a%a8%ea%b3%bc-%ec%b2%98%eb%a6%ac%ec%99%80-%eb%b9%84%eb%8f%99%ea%b8%b0-%ec%9e%91%ec%97%85-useeffect-%eb%b9%84%eb%8f%99%ea%b8%b0-%eb%8d%b0%ec%9d%b4%ed%84%b0-%ec%9a%94%ec%b2%ad-%eb%b0%8f-api","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/39095\/","title":{"rendered":"\ud6a8\uacfc \ucc98\ub9ac\uc640 \ube44\ub3d9\uae30 \uc791\uc5c5 (useEffect), \ube44\ub3d9\uae30 \ub370\uc774\ud130 \uc694\uccad \ubc0f API \uc5f0\ub3d9"},"content":{"rendered":"<p><body><\/p>\n<h2>\ud6a8\uacfc \ucc98\ub9ac\uc640 \ube44\ub3d9\uae30 \uc791\uc5c5 (useEffect), \ube44\ub3d9\uae30 \ub370\uc774\ud130 \uc694\uccad \ubc0f API \uc5f0\ub3d9<\/h2>\n<p>\ub9ac\uc561\ud2b8(React)\ub294 \uc0ac\uc6a9\uc790 \uc778\ud130\ud398\uc774\uc2a4\ub97c \uad6c\uc131\ud558\uae30 \uc704\ud55c \ub77c\uc774\ube0c\ub7ec\ub9ac\ub85c\uc11c, \ub2e8\uc77c \ud398\uc774\uc9c0 \uc560\ud50c\ub9ac\ucf00\uc774\uc158(SPA)\uc744 \uc27d\uac8c \uad6c\ucd95\ud560 \uc218 \uc788\uac8c \ud574\uc90d\ub2c8\ub2e4. \ub9ac\uc561\ud2b8\uc758 \uc8fc\uc694 \uac1c\ub150 \uc911 \ud558\ub098\ub294 \ucef4\ud3ec\ub10c\ud2b8\uc785\ub2c8\ub2e4. \uc774 \ucef4\ud3ec\ub10c\ud2b8\ub294 UI\uc758 \ub450\ub1cc \uc5ed\ud560\uc744 \ud558\uba70, \uac01 \ucef4\ud3ec\ub10c\ud2b8\ub294 \uc790\uc2e0\uc758 \uc0c1\ud0dc(state)\uc640 \uc18d\uc131(props)\uc744 \uad00\ub9ac\ud569\ub2c8\ub2e4. \uc774 \uae00\uc5d0\uc11c\ub294 \ud6a8\uacfc \ucc98\ub9ac\uc5d0 \ub110\ub9ac \uc0ac\uc6a9\ub418\ub294 <code>useEffect<\/code> \ud6c5\uacfc \ube44\ub3d9\uae30 \uc791\uc5c5\uc5d0 \ub300\ud574 \uc54c\uc544\ubcf4\uace0, \uc774\ub97c \ud65c\uc6a9\ud558\uc5ec API\ub85c\ubd80\ud130 \ub370\uc774\ud130\ub97c \uc694\uccad\ud558\ub294 \ubc29\ubc95\uc744 \uc2ec\ub3c4 \uae4a\uac8c \uc124\uba85\ud558\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n<h3>1. useEffect \ud6c5 \uc18c\uac1c<\/h3>\n<p><code>useEffect<\/code>\ub294 \ucef4\ud3ec\ub10c\ud2b8\uc758 \uc0dd\uba85\uc8fc\uae30 \uc5d0\uc11c \uc0ac\uc774\ub4dc \uc774\ud399\ud2b8\ub97c \ucc98\ub9ac\ud558\uae30 \uc704\ud55c \ud6c5\uc785\ub2c8\ub2e4. \uc8fc\ub85c \ub2e4\uc74c\uacfc \uac19\uc740 \uacbd\uc6b0\uc5d0 \uc0ac\uc6a9\ub429\ub2c8\ub2e4:<\/p>\n<ul>\n<li>\ub370\uc774\ud130\ub97c \uac00\uc838\uc62c \ub54c<\/li>\n<li>\uad6c\ub3c5(subscriptions)\uc744 \uc124\uc815\ud560 \ub54c<\/li>\n<li>DOM\uc744 \uc218\ub3d9\uc73c\ub85c \ubcc0\uacbd\ud560 \ub54c<\/li>\n<\/ul>\n<h4>1.1. \uae30\ubcf8 \uc0ac\uc6a9\ubc95<\/h4>\n<p><code>useEffect<\/code>\ub294 \ub450 \uac1c\uc758 \uc778\uc790\ub97c \ubc1b\uc2b5\ub2c8\ub2e4: \uccab \ubc88\uc9f8 \uc778\uc790\ub294 \uc0ac\uc774\ub4dc \uc774\ud399\ud2b8\ub97c \ubc1c\uc0dd\uc2dc\ud0a4\ub294 \ud568\uc218\uc774\uace0, \ub450 \ubc88\uc9f8 \uc778\uc790\ub294 \uc758\uc874\uc131 \ubc30\uc5f4\uc785\ub2c8\ub2e4. \uc758\uc874\uc131 \ubc30\uc5f4\uc5d0 \uc9c0\uc815\ub41c \uac12\uc774 \ubcc0\uacbd\ub420 \ub54c\ub9c8\ub2e4 \ud6a8\uacfc\uac00 \ub2e4\uc2dc \uc2e4\ud589 \ub429\ub2c8\ub2e4.<\/p>\n<pre><code>import { useEffect } from 'react';\n\nfunction MyComponent() {\n    useEffect(() =&gt; {\n        \/\/ \ud6a8\uacfc\ub97c \ucc98\ub9ac\ud558\ub294 \ucf54\ub4dc\n        document.title = 'My Component Loaded';\n\n        \/\/ \uc815\ub9ac(clean up) \ud568\uc218\n        return () =&gt; {\n            document.title = 'React App';\n        };\n    }, []); \/\/ \ube48 \ubc30\uc5f4\uc740 \ucef4\ud3ec\ub10c\ud2b8\uac00 \ub9c8\uc6b4\ud2b8\ub420 \ub54c\ub9cc \uc2e4\ud589\ub428\n\n    return &lt;div&gt;\uc548\ub155\ud558\uc138\uc694, \ub9ac\uc561\ud2b8 \ucef4\ud3ec\ub10c\ud2b8!&lt;\/div&gt;;\n}<\/code><\/pre>\n<p>\uc704 \uc608\uc81c\uc5d0\uc11c <code>useEffect<\/code>\ub294 \ucef4\ud3ec\ub10c\ud2b8\uac00 \ucc98\uc74c \ub80c\ub354\ub9c1\ub420 \ub54c \ud55c \ubc88\ub9cc \uc2e4\ud589\ub429\ub2c8\ub2e4. \uadf8\ub9ac\uace0 \ucef4\ud3ec\ub10c\ud2b8\uac00 \uc5b8\ub9c8\uc6b4\ud2b8\ub420 \ub54c \uc81c\ubaa9\uc744 \uc6d0\ub798 \uc0c1\ud0dc\ub85c \ub3cc\ub824 \ub193\uae30 \uc704\ud574 \uc815\ub9ac(clean up) \ud568\uc218\ub97c \ubc18\ud658\ud569\ub2c8\ub2e4.<\/p>\n<h4>1.2. \uc758\uc874\uc131 \ubc30\uc5f4\uc758 \uc911\uc694\uc131<\/h4>\n<p>\uc758\uc874\uc131 \ubc30\uc5f4\uc744 \uc124\uc815\ud558\uba74 \ud2b9\uc815 \uac12\uc774 \ubcc0\uacbd\ub420 \ub54c <code>useEffect<\/code>\uac00 \uc7ac\uc2e4\ud589\ub429\ub2c8\ub2e4. \uc608\ub97c \ub4e4\uc5b4, \ub2e4\uc74c\uacfc \uac19\uc774 <code>count<\/code>\ub77c\ub294 \uc0c1\ud0dc \uac12\uc744 \uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/p>\n<pre><code>import React, { useState, useEffect } from 'react';\n\nfunction Counter() {\n    const [count, setCount] = useState(0);\n\n    useEffect(() =&gt; {\n        document.title = `\uce74\uc6b4\ud2b8: ${count}`;\n    }, [count]); \/\/ count\uac00 \ubcc0\uacbd\ub420 \ub54c\ub9c8\ub2e4 \uc2e4\ud589\ub428\n\n    return (\n        &lt;div&gt;\n            &lt;p&gt;\ud604\uc7ac \uce74\uc6b4\ud2b8: {count}&lt;\/p&gt;\n            &lt;button onClick={() =&gt; setCount(count + 1)}&gt;\uce74\uc6b4\ud2b8 \uc99d\uac00&lt;\/button&gt;\n        &lt;\/div&gt;\n    );\n}<\/code><\/pre>\n<p>\uc774 \uacbd\uc6b0, \ubc84\ud2bc\uc744 \ud074\ub9ad\ud558\uc5ec \uce74\uc6b4\ud2b8\ub97c \uc99d\uac00\uc2dc\ud0a4\uba74 \uc81c\ubaa9\uc774 \ubcc0\uacbd\ub429\ub2c8\ub2e4.<\/p>\n<h3>2. \ube44\ub3d9\uae30 \ub370\uc774\ud130 \uc694\uccad<\/h3>\n<p>\ub9ac\uc561\ud2b8\uc5d0\uc11c API\ub97c \ud1b5\ud574 \ub370\uc774\ud130\ub97c \uc694\uccad\ud560 \ub54c\ub294 \uc77c\ubc18\uc801\uc73c\ub85c <code>fetch<\/code> API\ub97c \uc0ac\uc6a9\ud569\ub2c8\ub2e4. \ube44\ub3d9\uae30 \uc791\uc5c5\uc744 \uc218\ud589\ud558\uae30 \uc704\ud574 <code>useEffect<\/code>\uc640 \ud568\uaed8 <code>async\/await<\/code> \ud328\ud134\uc744 \uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ub2e4\uc74c\uc740 \ub370\uc774\ud130\ub97c API\ub85c\ubd80\ud130 fetch\ud558\ub294 \uac04\ub2e8\ud55c \uc608\uc81c\uc785\ub2c8\ub2e4.<\/p>\n<pre><code>import React, { useState, useEffect } from 'react';\n\nfunction DataFetchingComponent() {\n    const [data, setData] = useState(null);\n    const [loading, setLoading] = useState(true);\n    const [error, setError] = useState(null);\n\n    useEffect(() =&gt; {\n        const fetchData = async () =&gt; {\n            try {\n                const response = await fetch('https:\/\/api.example.com\/data');\n                if (!response.ok) {\n                    throw new Error('\ub124\ud2b8\uc6cc\ud06c \uc751\ub2f5\uc5d0 \ubb38\uc81c\uac00 \uc788\uc2b5\ub2c8\ub2e4.');\n                }\n                const result = await response.json();\n                setData(result);\n            } catch (error) {\n                setError(error);\n            } finally {\n                setLoading(false);\n            }\n        };\n\n        fetchData(); \/\/ \ube44\ub3d9\uae30 \ud568\uc218 \ud638\ucd9c\n    }, []); \/\/ \ube48 \ubc30\uc5f4\uc740 \ucef4\ud3ec\ub10c\ud2b8\uac00 \ub9c8\uc6b4\ud2b8\ub420 \ub54c\ub9cc \uc2e4\ud589\ub428\n\n    if (loading) return &lt;p&gt;\ub85c\ub529 \uc911...&lt;\/p&gt;;\n    if (error) return &lt;p&gt;\uc624\ub958: {error.message}&lt;\/p&gt;;\n    return &lt;pre&gt;{JSON.stringify(data, null, 2)}&lt;\/pre&gt;;\n}<\/code><\/pre>\n<p>\uc704 \uc608\uc81c\uc5d0\uc11c\ub294 API \uc694\uccad\uc744 \ud1b5\ud574 \ub370\uc774\ud130\ub97c \uac00\uc838\uc628 \ud6c4, \ub85c\ub529 \uc0c1\ud0dc\ub97c \uad00\ub9ac\ud558\uace0, \uc624\ub958 \ucc98\ub9ac\ub3c4 \uc218\ud589\ud569\ub2c8\ub2e4. <code>useEffect<\/code> \ub0b4\ubd80\uc5d0\uc11c \ube44\ub3d9\uae30 \ud568\uc218\ub97c \uc120\uc5b8\ud558\uace0 \ud638\ucd9c\ud558\ub294 \ubc29\uc2dd\uc73c\ub85c \uc9c4\ud589\ub429\ub2c8\ub2e4.<\/p>\n<h3>3. API \uc5f0\ub3d9 \uc2e4\uc2b5<\/h3>\n<p>\uc774\uc81c API \uc5f0\ub3d9\uc758 \uc2e4\uc81c \uc608\uc81c\ub97c \ub9cc\ub4e4\uc5b4 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4. JSONPlaceholder\ub77c\ub294 \ubb34\ub8cc API\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc0ac\uc6a9\uc790 \ubaa9\ub85d\uc744 \uac00\uc838\uc624\ub294 \uac04\ub2e8\ud55c \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \ub9cc\ub4e4\uc5b4 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n<pre><code>import React, { useState, useEffect } from 'react';\n\nfunction UserList() {\n    const [users, setUsers] = useState([]);\n    const [loading, setLoading] = useState(true);\n    const [error, setError] = useState(null);\n\n    useEffect(() =&gt; {\n        const fetchUsers = async () =&gt; {\n            setLoading(true);\n            try {\n                const response = await fetch('https:\/\/jsonplaceholder.typicode.com\/users');\n                if (!response.ok) throw new Error('\ub124\ud2b8\uc6cc\ud06c \uc751\ub2f5\uc5d0 \ubb38\uc81c\uac00 \uc788\uc2b5\ub2c8\ub2e4.');\n                const data = await response.json();\n                setUsers(data);\n            } catch (error) {\n                setError(error);\n            } finally {\n                setLoading(false);\n            }\n        };\n\n        fetchUsers();\n    }, []);\n\n    if (loading) return &lt;p&gt;\ub85c\ub529 \uc911...&lt;\/p&gt;;\n    if (error) return &lt;p&gt;\uc624\ub958: {error.message}&lt;\/p&gt;;\n\n    return (\n        &lt;ul&gt;\n            {users.map(user =&gt; (\n                &lt;li key={user.id}&gt;{user.name} ({user.email})&lt;\/li&gt;\n            ))}\n        &lt;\/ul&gt;\n    );\n}<\/code><\/pre>\n<p>\uc704\uc758 <code>UserList<\/code> \ucef4\ud3ec\ub10c\ud2b8\ub294 \uc0ac\uc6a9\uc790\uc758 \ubaa9\ub85d\uc744 \uac00\uc838\uc640 \ud654\uba74\uc5d0 \ud45c\uc2dc\ud569\ub2c8\ub2e4. \ub370\uc774\ud130\uac00 \ub85c\ub529 \uc911\uc77c \ub54c\ub294 \ub85c\ub529 \uba54\uc2dc\uc9c0\ub97c \ubcf4\uc5ec\uc8fc\uace0, \uc624\ub958\uac00 \ubc1c\uc0dd\ud558\uba74 \uc624\ub958 \uba54\uc2dc\uc9c0\ub97c \ud45c\uc2dc\ud569\ub2c8\ub2e4.<\/p>\n<h3>4. \uc815\ub9ac<\/h3>\n<p><code>useEffect<\/code> \ud6c5\uc744 \ud65c\uc6a9\ud558\uc5ec \ucef4\ud3ec\ub10c\ud2b8\uc758 \uc0dd\uba85 \uc8fc\uae30\uc5d0\uc11c \uc0ac\uc774\ub4dc \uc774\ud399\ud2b8\ub97c \ucc98\ub9ac\ud558\uace0, \ube44\ub3d9\uae30 \uc791\uc5c5\uc744 \ud1b5\ud574 \uc678\ubd80 API\uc640 \uc5f0\ub3d9\ud558\ub294 \uacfc\uc815\uc744 \uc0b4\ud3b4\ubcf4\uc558\uc2b5\ub2c8\ub2e4. \uc774 \ud328\ud134\uc740 \ub9ac\uc561\ud2b8 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c \ub370\uc774\ud130 fetching \ubc0f \uad00\ub9ac\uc5d0\uc11c \ud544\uc218\uc801\uc778 \ubd80\ubd84\uc785\ub2c8\ub2e4. \ub2e4\uc591\ud55c API\ub97c \ud65c\uc6a9\ud558\uc5ec \ub370\uc774\ud130\uc758 \uc0c1\ud0dc\ub97c \uad00\ub9ac\ud558\uace0 \uc0ac\uc6a9\uc790\uc5d0\uac8c \ub354\uc6b1 \ud48d\ubd80\ud55c \uacbd\ud5d8\uc744 \uc81c\uacf5\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\ub354 \ub098\uc544\uac00 \ub9ac\uc561\ud2b8 \ucffc\ub9ac(React Query) \uac19\uc740 \ub77c\uc774\ube0c\ub7ec\ub9ac\ub97c \uc0ac\uc6a9\ud558\uc5ec API \ud638\ucd9c \ubc0f \ub370\uc774\ud130 \uce90\uc2f1\uc744 \uad00\ub9ac\ud558\uba74 \ud6e8\uc52c \ub354 \ud6a8\uc728\uc801\uc778 \uc791\uc5c5\uc774 \uac00\ub2a5\ud569\ub2c8\ub2e4. \ud558\uc9c0\ub9cc \uc774 \uae00\uc5d0\uc11c\ub294 \uac00\uc7a5 \uac04\ub2e8\ud558\uace0 \uae30\ubcf8\uc801\uc778 \ubc29\uc2dd\uc73c\ub85c API \uc5f0\ub3d9\uc744 \ub2e4\ub8e8\uc5c8\uc2b5\ub2c8\ub2e4. \uc55e\uc73c\ub85c \ub354 \ubc1c\uc804\ub41c \uae30\uc220\uacfc \ud328\ud134\uc744 \ubc30\uc6b0\uace0 \uc801\uc6a9\ud574 \ubcf4\uc2dc\uae30 \ubc14\ub78d\ub2c8\ub2e4.<\/p>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ud6a8\uacfc \ucc98\ub9ac\uc640 \ube44\ub3d9\uae30 \uc791\uc5c5 (useEffect), \ube44\ub3d9\uae30 \ub370\uc774\ud130 \uc694\uccad \ubc0f API \uc5f0\ub3d9 \ub9ac\uc561\ud2b8(React)\ub294 \uc0ac\uc6a9\uc790 \uc778\ud130\ud398\uc774\uc2a4\ub97c \uad6c\uc131\ud558\uae30 \uc704\ud55c \ub77c\uc774\ube0c\ub7ec\ub9ac\ub85c\uc11c, \ub2e8\uc77c \ud398\uc774\uc9c0 \uc560\ud50c\ub9ac\ucf00\uc774\uc158(SPA)\uc744 \uc27d\uac8c \uad6c\ucd95\ud560 \uc218 \uc788\uac8c \ud574\uc90d\ub2c8\ub2e4. \ub9ac\uc561\ud2b8\uc758 \uc8fc\uc694 \uac1c\ub150 \uc911 \ud558\ub098\ub294 \ucef4\ud3ec\ub10c\ud2b8\uc785\ub2c8\ub2e4. \uc774 \ucef4\ud3ec\ub10c\ud2b8\ub294 UI\uc758 \ub450\ub1cc \uc5ed\ud560\uc744 \ud558\uba70, \uac01 \ucef4\ud3ec\ub10c\ud2b8\ub294 \uc790\uc2e0\uc758 \uc0c1\ud0dc(state)\uc640 \uc18d\uc131(props)\uc744 \uad00\ub9ac\ud569\ub2c8\ub2e4. \uc774 \uae00\uc5d0\uc11c\ub294 \ud6a8\uacfc \ucc98\ub9ac\uc5d0 \ub110\ub9ac \uc0ac\uc6a9\ub418\ub294 useEffect \ud6c5\uacfc \ube44\ub3d9\uae30 \uc791\uc5c5\uc5d0 \ub300\ud574 \uc54c\uc544\ubcf4\uace0, &hellip; <a href=\"https:\/\/atmokpo.com\/w\/39095\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;\ud6a8\uacfc \ucc98\ub9ac\uc640 \ube44\ub3d9\uae30 \uc791\uc5c5 (useEffect), \ube44\ub3d9\uae30 \ub370\uc774\ud130 \uc694\uccad \ubc0f API \uc5f0\ub3d9&#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":[191],"tags":[],"class_list":["post-39095","post","type-post","status-publish","format-standard","hentry","category-react"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\ud6a8\uacfc \ucc98\ub9ac\uc640 \ube44\ub3d9\uae30 \uc791\uc5c5 (useEffect), \ube44\ub3d9\uae30 \ub370\uc774\ud130 \uc694\uccad \ubc0f API \uc5f0\ub3d9 - \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\/39095\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\ud6a8\uacfc \ucc98\ub9ac\uc640 \ube44\ub3d9\uae30 \uc791\uc5c5 (useEffect), \ube44\ub3d9\uae30 \ub370\uc774\ud130 \uc694\uccad \ubc0f API \uc5f0\ub3d9 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"\ud6a8\uacfc \ucc98\ub9ac\uc640 \ube44\ub3d9\uae30 \uc791\uc5c5 (useEffect), \ube44\ub3d9\uae30 \ub370\uc774\ud130 \uc694\uccad \ubc0f API \uc5f0\ub3d9 \ub9ac\uc561\ud2b8(React)\ub294 \uc0ac\uc6a9\uc790 \uc778\ud130\ud398\uc774\uc2a4\ub97c \uad6c\uc131\ud558\uae30 \uc704\ud55c \ub77c\uc774\ube0c\ub7ec\ub9ac\ub85c\uc11c, \ub2e8\uc77c \ud398\uc774\uc9c0 \uc560\ud50c\ub9ac\ucf00\uc774\uc158(SPA)\uc744 \uc27d\uac8c \uad6c\ucd95\ud560 \uc218 \uc788\uac8c \ud574\uc90d\ub2c8\ub2e4. \ub9ac\uc561\ud2b8\uc758 \uc8fc\uc694 \uac1c\ub150 \uc911 \ud558\ub098\ub294 \ucef4\ud3ec\ub10c\ud2b8\uc785\ub2c8\ub2e4. \uc774 \ucef4\ud3ec\ub10c\ud2b8\ub294 UI\uc758 \ub450\ub1cc \uc5ed\ud560\uc744 \ud558\uba70, \uac01 \ucef4\ud3ec\ub10c\ud2b8\ub294 \uc790\uc2e0\uc758 \uc0c1\ud0dc(state)\uc640 \uc18d\uc131(props)\uc744 \uad00\ub9ac\ud569\ub2c8\ub2e4. \uc774 \uae00\uc5d0\uc11c\ub294 \ud6a8\uacfc \ucc98\ub9ac\uc5d0 \ub110\ub9ac \uc0ac\uc6a9\ub418\ub294 useEffect \ud6c5\uacfc \ube44\ub3d9\uae30 \uc791\uc5c5\uc5d0 \ub300\ud574 \uc54c\uc544\ubcf4\uace0, &hellip; \ub354 \ubcf4\uae30 &quot;\ud6a8\uacfc \ucc98\ub9ac\uc640 \ube44\ub3d9\uae30 \uc791\uc5c5 (useEffect), \ube44\ub3d9\uae30 \ub370\uc774\ud130 \uc694\uccad \ubc0f API \uc5f0\ub3d9&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/39095\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-02T02:36:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-26T06:42:27+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\/39095\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/39095\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"\ud6a8\uacfc \ucc98\ub9ac\uc640 \ube44\ub3d9\uae30 \uc791\uc5c5 (useEffect), \ube44\ub3d9\uae30 \ub370\uc774\ud130 \uc694\uccad \ubc0f API \uc5f0\ub3d9\",\"datePublished\":\"2024-11-02T02:36:57+00:00\",\"dateModified\":\"2024-11-26T06:42:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/39095\/\"},\"wordCount\":31,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"React\ud504\ub860\ud2b8\uc5d4\ub4dc\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/39095\/\",\"url\":\"https:\/\/atmokpo.com\/w\/39095\/\",\"name\":\"\ud6a8\uacfc \ucc98\ub9ac\uc640 \ube44\ub3d9\uae30 \uc791\uc5c5 (useEffect), \ube44\ub3d9\uae30 \ub370\uc774\ud130 \uc694\uccad \ubc0f API \uc5f0\ub3d9 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-02T02:36:57+00:00\",\"dateModified\":\"2024-11-26T06:42:27+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/39095\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/39095\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/39095\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\ud6a8\uacfc \ucc98\ub9ac\uc640 \ube44\ub3d9\uae30 \uc791\uc5c5 (useEffect), \ube44\ub3d9\uae30 \ub370\uc774\ud130 \uc694\uccad \ubc0f API \uc5f0\ub3d9\"}]},{\"@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":"\ud6a8\uacfc \ucc98\ub9ac\uc640 \ube44\ub3d9\uae30 \uc791\uc5c5 (useEffect), \ube44\ub3d9\uae30 \ub370\uc774\ud130 \uc694\uccad \ubc0f API \uc5f0\ub3d9 - \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\/39095\/","og_locale":"ko_KR","og_type":"article","og_title":"\ud6a8\uacfc \ucc98\ub9ac\uc640 \ube44\ub3d9\uae30 \uc791\uc5c5 (useEffect), \ube44\ub3d9\uae30 \ub370\uc774\ud130 \uc694\uccad \ubc0f API \uc5f0\ub3d9 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"\ud6a8\uacfc \ucc98\ub9ac\uc640 \ube44\ub3d9\uae30 \uc791\uc5c5 (useEffect), \ube44\ub3d9\uae30 \ub370\uc774\ud130 \uc694\uccad \ubc0f API \uc5f0\ub3d9 \ub9ac\uc561\ud2b8(React)\ub294 \uc0ac\uc6a9\uc790 \uc778\ud130\ud398\uc774\uc2a4\ub97c \uad6c\uc131\ud558\uae30 \uc704\ud55c \ub77c\uc774\ube0c\ub7ec\ub9ac\ub85c\uc11c, \ub2e8\uc77c \ud398\uc774\uc9c0 \uc560\ud50c\ub9ac\ucf00\uc774\uc158(SPA)\uc744 \uc27d\uac8c \uad6c\ucd95\ud560 \uc218 \uc788\uac8c \ud574\uc90d\ub2c8\ub2e4. \ub9ac\uc561\ud2b8\uc758 \uc8fc\uc694 \uac1c\ub150 \uc911 \ud558\ub098\ub294 \ucef4\ud3ec\ub10c\ud2b8\uc785\ub2c8\ub2e4. \uc774 \ucef4\ud3ec\ub10c\ud2b8\ub294 UI\uc758 \ub450\ub1cc \uc5ed\ud560\uc744 \ud558\uba70, \uac01 \ucef4\ud3ec\ub10c\ud2b8\ub294 \uc790\uc2e0\uc758 \uc0c1\ud0dc(state)\uc640 \uc18d\uc131(props)\uc744 \uad00\ub9ac\ud569\ub2c8\ub2e4. \uc774 \uae00\uc5d0\uc11c\ub294 \ud6a8\uacfc \ucc98\ub9ac\uc5d0 \ub110\ub9ac \uc0ac\uc6a9\ub418\ub294 useEffect \ud6c5\uacfc \ube44\ub3d9\uae30 \uc791\uc5c5\uc5d0 \ub300\ud574 \uc54c\uc544\ubcf4\uace0, &hellip; \ub354 \ubcf4\uae30 \"\ud6a8\uacfc \ucc98\ub9ac\uc640 \ube44\ub3d9\uae30 \uc791\uc5c5 (useEffect), \ube44\ub3d9\uae30 \ub370\uc774\ud130 \uc694\uccad \ubc0f API \uc5f0\ub3d9\"","og_url":"https:\/\/atmokpo.com\/w\/39095\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-02T02:36:57+00:00","article_modified_time":"2024-11-26T06:42:27+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\/39095\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/39095\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"\ud6a8\uacfc \ucc98\ub9ac\uc640 \ube44\ub3d9\uae30 \uc791\uc5c5 (useEffect), \ube44\ub3d9\uae30 \ub370\uc774\ud130 \uc694\uccad \ubc0f API \uc5f0\ub3d9","datePublished":"2024-11-02T02:36:57+00:00","dateModified":"2024-11-26T06:42:27+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/39095\/"},"wordCount":31,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["React\ud504\ub860\ud2b8\uc5d4\ub4dc"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/39095\/","url":"https:\/\/atmokpo.com\/w\/39095\/","name":"\ud6a8\uacfc \ucc98\ub9ac\uc640 \ube44\ub3d9\uae30 \uc791\uc5c5 (useEffect), \ube44\ub3d9\uae30 \ub370\uc774\ud130 \uc694\uccad \ubc0f API \uc5f0\ub3d9 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-02T02:36:57+00:00","dateModified":"2024-11-26T06:42:27+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/39095\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/39095\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/39095\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"\ud6a8\uacfc \ucc98\ub9ac\uc640 \ube44\ub3d9\uae30 \uc791\uc5c5 (useEffect), \ube44\ub3d9\uae30 \ub370\uc774\ud130 \uc694\uccad \ubc0f API \uc5f0\ub3d9"}]},{"@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\/39095","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=39095"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/39095\/revisions"}],"predecessor-version":[{"id":39096,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/39095\/revisions\/39096"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=39095"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=39095"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=39095"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}