{"id":38956,"date":"2024-11-02T02:35:53","date_gmt":"2024-11-02T02:35:53","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=38956"},"modified":"2024-11-26T06:42:49","modified_gmt":"2024-11-26T06:42:49","slug":"context-api%ec%99%80-%ec%a0%84%ec%97%ad-%ec%83%81%ed%83%9c-%ea%b4%80%eb%a6%ac-%eb%8b%a4%ec%96%91%ed%95%9c-context-%ec%98%88%ec%a0%9c%ec%99%80-%ed%99%9c%ec%9a%a9%eb%b2%95","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/38956\/","title":{"rendered":"Context API\uc640 \uc804\uc5ed \uc0c1\ud0dc \uad00\ub9ac, \ub2e4\uc591\ud55c Context \uc608\uc81c\uc640 \ud65c\uc6a9\ubc95"},"content":{"rendered":"<p><body><\/p>\n<article>\n<p>\n            \ucd5c\uadfc Frontend \uac1c\ubc1c\uc5d0\uc11c \uc0c1\ud0dc \uad00\ub9ac \ub77c\uc774\ube0c\ub7ec\ub9ac\ub4e4\uc774 \ub9ce\uc774 \uc0ac\uc6a9\ud558\ub294\ub370, \uadf8 \uc911\uc5d0\uc11c\ub3c4 Redux, MobX\uc640 \uac19\uc740 \ub77c\uc774\ube0c\ub7ec\ub9ac\ub4e4\uc774 \ub9ce\uc774 \uc54c\ub824\uc838 \uc788\uc2b5\ub2c8\ub2e4. \ud558\uc9c0\ub9cc React \ud300\uc5d0\uc11c \uc81c\uacf5\ud558\ub294 Context API\ub97c \uc0ac\uc6a9\ud558\uba74, \ubcf5\uc7a1\ud55c \uc0c1\ud0dc \uad00\ub9ac\ub97c \uc27d\uac8c \uad6c\ud604\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. Context API\ub294 \uac04\ub2e8\ud55c API\ub97c \uc81c\uacf5\ud558\uba74\uc11c\ub3c4 \ub2e4\uc591\ud55c \uc0c1\ud0dc \uad00\ub9ac \uc2dc\ub098\ub9ac\uc624\ub97c \uc9c0\uc6d0\ud558\uc5ec \uac1c\ubc1c\uc790\ub4e4\uc774 \ubcf4\ub2e4 \ub354 \ud6a8\uc728\uc801\uc73c\ub85c \uc804\uc5ed \uc0c1\ud0dc\ub97c \uad00\ub9ac\ud560 \uc218 \uc788\ub3c4\ub85d \ub3c4\uc640\uc90d\ub2c8\ub2e4.\n        <\/p>\n<h2>1. Context API \uae30\ubcf8 \uac1c\ub150<\/h2>\n<p>\n            Context API\ub294 React\uc5d0\uc11c \ucef4\ud3ec\ub10c\ud2b8 \ud2b8\ub9ac \uc804\uc5ed\uc5d0\uc11c \uac12\uc744 \uacf5\uc720\ud560 \uc218 \uc788\ub3c4\ub85d \ud574\uc8fc\ub294 \uba54\ucee4\ub2c8\uc998\uc785\ub2c8\ub2e4. \uc774\ub97c \ud1b5\ud574 \ucef4\ud3ec\ub10c\ud2b8 \uac04\uc5d0 props\ub97c \uc218\ub3d9\uc73c\ub85c \uc804\ud30c\ud558\uc9c0 \uc54a\uace0\ub3c4 \ud544\uc694\ud55c \ub370\uc774\ud130\uc5d0 \uc811\uadfc\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uad6c\uccb4\uc801\uc73c\ub85c\ub294 Context\ub97c \uc0dd\uc131\ud558\uace0, Provider\ub85c \ub370\uc774\ud130\ub97c \uc81c\uacf5\ud558\uace0, Consumer\ub85c \ub370\uc774\ud130\ub97c \uc0ac\uc6a9\ud558\ub294 \ubc29\uc2dd\uc73c\ub85c \uc791\ub3d9\ud569\ub2c8\ub2e4.\n        <\/p>\n<h3>1.1 Context \uc0dd\uc131<\/h3>\n<p>\n            Context\ub97c \uc0dd\uc131\ud558\uae30 \uc704\ud574 React\uc758 <code>createContext<\/code> \uba54\uc11c\ub4dc\ub97c \uc0ac\uc6a9\ud569\ub2c8\ub2e4. \uc774 \uba54\uc11c\ub4dc\ub294 \uae30\ubcf8\uac12\uc744 \uc778\uc790\ub85c \ubc1b\uc544\uc11c Context \uac1d\uccb4\ub97c \ubc18\ud658\ud569\ub2c8\ub2e4.\n        <\/p>\n<pre><code>\nconst MyContext = React.createContext(defaultValue);\n        <\/code><\/pre>\n<h3>1.2 Provider<\/h3>\n<p>\n            Context\uc758 Provider\ub294 \ud558\uc704 \ucef4\ud3ec\ub10c\ud2b8\uc5d0 \uac12\uc744 \uc804\ub2ec\ud558\ub294 \uc5ed\ud560\uc744 \ud569\ub2c8\ub2e4. Provider\ub294 <code>value<\/code> \uc18d\uc131\uc744 \ud1b5\ud574 \uc81c\uacf5\ud560 \uac12\uc744 \uc124\uc815\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ud558\uc704 \ucef4\ud3ec\ub10c\ud2b8\ub294 \uc774 \uac12\uc744 \uc77d\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n        <\/p>\n<pre><code>\n<mycontext.provider *=\"\" value=\"{\/*\" }=\"\" \uac12=\"\" \uc5b4\ub5a4=\"\">\n  {\/* \ud558\uc704 \ucef4\ud3ec\ub10c\ud2b8 *\/}\n<\/mycontext.provider>\n        <\/code><\/pre>\n<h3>1.3 Consumer<\/h3>\n<p>\n            Consumer\ub294 Context\uc5d0\uc11c \uc81c\uacf5\ud558\ub294 \uac12\uc744 \uc561\uc138\uc2a4\ud558\ub294 \ubc29\uc2dd\uc73c\ub85c \uc0ac\uc6a9\ud569\ub2c8\ub2e4. \uc0ac\uc6a9\ubc95\uc740 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4:\n        <\/p>\n<pre><code>\n<mycontext.consumer>\n  {value =&gt; \/* value\ub97c \uc0ac\uc6a9 *\/}\n<\/mycontext.consumer>\n        <\/code><\/pre>\n<h2>2. \uc804\uc5ed \uc0c1\ud0dc \uad00\ub9ac<\/h2>\n<p>\n            \ub9ce\uc740 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c \uc0c1\ud0dc\ub294 \ucef4\ud3ec\ub10c\ud2b8 \uac04\uc5d0 \uc790\uc8fc \uacf5\uc720\ub418\uc5b4\uc57c \ud558\uba70, \uc0c1\ud0dc\uc758 \ubcf5\uc7a1\uc131\uc774 \uc99d\uac00\ud568\uc5d0 \ub530\ub77c \ud6a8\uc728\uc801\uc73c\ub85c \uad00\ub9ac\ud558\ub294 \uac83\uc774 \uc911\uc694\ud569\ub2c8\ub2e4. Context API\ub97c \ud1b5\ud574 \uc804\uc5ed \uc0c1\ud0dc\ub97c \uad00\ub9ac\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \ub2e8\uc21c\ud55c \uce74\uc6b4\ud130 \uc608\uc81c\ub97c \ud1b5\ud574 \uc804\uc5ed \uc0c1\ud0dc\ub97c \uad00\ub9ac\ud558\ub294 \ubc29\ubc95\uc744 \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4.\n        <\/p>\n<h3>2.1 \uc608\uc81c: \uce74\uc6b4\ud130 \uc560\ud50c\ub9ac\ucf00\uc774\uc158<\/h3>\n<pre><code>\nimport React, { createContext, useState, useContext } from 'react';\n\n\/\/ Context \uc0dd\uc131\nconst CounterContext = createContext();\n\nconst CounterProvider = ({ children }) =&gt; {\n    const [count, setCount] = useState(0);\n\n    const increment = () =&gt; setCount(count + 1);\n    const decrement = () =&gt; setCount(count - 1);\n\n    return (\n        <countercontext.provider count,=\"\" decrement=\"\" increment,=\"\" value=\"{{\" }}=\"\">\n            {children}\n        <\/countercontext.provider>\n    );\n};\n\nconst CounterDisplay = () =&gt; {\n    const { count } = useContext(CounterContext);\n    return <h2>\ud604\uc7ac \uce74\uc6b4\ud2b8: {count}<\/h2>;\n};\n\nconst CounterButtons = () =&gt; {\n    const { increment, decrement } = useContext(CounterContext);\n    return (\n        <div>\n            <button onclick=\"{increment}\">\uc99d\uac00<\/button>\n            <button onclick=\"{decrement}\">\uac10\uc18c<\/button>\n        <\/div>\n    );\n};\n\nconst App = () =&gt; {\n    return (\n        <counterprovider>\n            <counterdisplay><\/counterdisplay>\n            <counterbuttons><\/counterbuttons>\n        <\/counterprovider>\n    );\n};\n\nexport default App;\n        <\/code><\/pre>\n<p>\n            \uc704 \uc608\uc81c\uc5d0\uc11c\ub294 <code>CounterContext<\/code>\ub97c \uc0ac\uc6a9\ud558\uc5ec \uce74\uc6b4\ud2b8 \uc0c1\ud0dc\ub97c \uc804\uc5ed\uc73c\ub85c \uad00\ub9ac\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. <code>CounterProvider<\/code>\ub294 \uc0c1\ud0dc\uc640 \uc0c1\ud0dc\ub97c \ubcc0\uacbd\ud558\ub294 \uba54\uc11c\ub4dc\ub97c \uc81c\uacf5\ud558\uace0, \uc774\ub97c <code>CounterDisplay<\/code>\uc640 <code>CounterButtons<\/code> \ucef4\ud3ec\ub10c\ud2b8\uc5d0\uc11c \uc0ac\uc6a9\ud569\ub2c8\ub2e4. \uc774 \uad6c\uc870\ub97c \ud1b5\ud574 \ucf54\ub4dc\uc758 \uac00\ub3c5\uc131\uc774 \ub192\uc544\uc9c0\uace0 \uc720\uc9c0\ubcf4\uc218\ud558\uae30 \uc26c\uc6b4 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \ub9cc\ub4e4 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n        <\/p>\n<h2>3. Context API\uc758 \ub2e4\uc591\ud55c \ud65c\uc6a9 \uc0ac\ub840<\/h2>\n<p>\n            Context API\ub294 \ub2e4\uc591\ud55c \uc0c1\ud669\uc5d0\uc11c \ud65c\uc6a9\ub420 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc5ec\uae30\uc11c\ub294 \uba87 \uac00\uc9c0 \uc0ac\ub840\ub97c \uc0b4\ud3b4\ubcf4\ub3c4\ub85d \ud558\uaca0\uc2b5\ub2c8\ub2e4.\n        <\/p>\n<h3>3.1 \uc0ac\uc6a9\uc790 \uc778\uc99d \uc0c1\ud0dc \uad00\ub9ac<\/h3>\n<p>\n            \ub85c\uadf8\uc778 \ubc0f \ub85c\uadf8\uc544\uc6c3 \uc0c1\ud0dc\ub97c \uad00\ub9ac\ud558\ub294 \uacbd\uc6b0, Context API\ub97c \ud1b5\ud574 \uc804\uc5ed\uc801\uc73c\ub85c \uc0ac\uc6a9\uc790 \uc0c1\ud0dc\ub97c \uad00\ub9ac\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc608\ub97c \ub4e4\uc5b4, \uc0ac\uc6a9\uc790\uac00 \ub85c\uadf8\uc778\ud558\uba74 \uc774\ub97c Context\ub97c \ud1b5\ud574 \ubaa8\ub4e0 \ucef4\ud3ec\ub10c\ud2b8\uc5d0\uc11c \uc27d\uac8c \uc811\uadfc\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n        <\/p>\n<pre><code>\nconst AuthContext = createContext();\n\nconst AuthProvider = ({ children }) =&gt; {\n    const [user, setUser] = useState(null);\n\n    const login = (userData) =&gt; setUser(userData);\n    const logout = () =&gt; setUser(null);\n\n    return (\n        <authcontext.provider login,=\"\" logout=\"\" user,=\"\" value=\"{{\" }}=\"\">\n            {children}\n        <\/authcontext.provider>\n    );\n};\n\n\/\/ \uc0ac\uc6a9 \uc608\nconst Profile = () =&gt; {\n    const { user } = useContext(AuthContext);\n    return <div>{user ? `\ud658\uc601\ud569\ub2c8\ub2e4, ${user.name}` : '\ub85c\uadf8\uc778 \ud574\uc8fc\uc138\uc694.'}<\/div>;\n};\n        <\/code><\/pre>\n<h3>3.2 \ub2e4\uad6d\uc5b4 \uc9c0\uc6d0<\/h3>\n<p>\n            \ub2e4\uad6d\uc5b4 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c\ub3c4 Context API\ub97c \ud65c\uc6a9\ud558\uc5ec \uc0ac\uc6a9\uc790\uc758 \uc5b8\uc5b4 \uc124\uc815\uc744 \uc804\uc5ed\uc73c\ub85c \uad00\ub9ac\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc0ac\uc6a9\uc790 \uc5b8\uc5b4\uc5d0 \ub530\ub77c \ud14d\uc2a4\ud2b8\ub97c \ub3d9\uc801\uc73c\ub85c \ubcc0\uacbd\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n        <\/p>\n<pre><code>\nconst LanguageContext = createContext();\n\nconst LanguageProvider = ({ children }) =&gt; {\n    const [language, setLanguage] = useState('kor');\n\n    const changeLanguage = (lang) =&gt; setLanguage(lang);\n\n    return (\n        <languagecontext.provider changelanguage=\"\" language,=\"\" value=\"{{\" }}=\"\">\n            {children}\n        <\/languagecontext.provider>\n    );\n};\n\n\/\/ \uc0ac\uc6a9 \uc608\nconst DisplayGreeting = () =&gt; {\n    const { language } = useContext(LanguageContext);\n    return <h2>{language === 'kor' ? '\uc548\ub155\ud558\uc138\uc694!' : 'Hello!'}<\/h2>;\n};\n        <\/code><\/pre>\n<h2>4. Context API\uc758 \uc7a5\ub2e8\uc810<\/h2>\n<p>\n            Context API\ub97c \uc0ac\uc6a9\ud560 \ub54c\uc758 \uc7a5\ub2e8\uc810\uc5d0 \ub300\ud574 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4.\n        <\/p>\n<h3>4.1 \uc7a5\uc810<\/h3>\n<ul>\n<li>\uc804\uc5ed \uc0c1\ud0dc \uad00\ub9ac\uac00 \uac04\ud3b8\ud574\uc9d0<\/li>\n<li>Provider\uc640 Consumer\ub97c \ud1b5\ud55c \uc9c1\uad00\uc801\uc778 \uad6c\uc870<\/li>\n<li>\uc18c\uc2a4 \ucf54\ub4dc\uac00 \uac04\uacb0\ud574\uc9c0\uba70 \uc720\uc9c0\ubcf4\uc218\uac00 \uc6a9\uc774\ud574\uc9d0<\/li>\n<li>Context\ub97c \ud1b5\ud574 \ub80c\ub354\ub9c1 \ucd5c\uc801\ud654\ub97c \ud560 \uc218 \uc788\uc74c<\/li>\n<\/ul>\n<h3>4.2 \ub2e8\uc810<\/h3>\n<ul>\n<li>\uc0c1\ud0dc\uac00 \ubcc0\uacbd\ub420 \uacbd\uc6b0 \ubaa8\ub4e0 \ud558\uc704 \ucef4\ud3ec\ub10c\ud2b8\uac00 \ub9ac\ub80c\ub354\ub9c1 \ub418\ubbc0\ub85c \uc131\ub2a5 \uc774\uc288\uac00 \ubc1c\uc0dd\ud560 \uc218 \uc788\uc74c<\/li>\n<li>Context\uac00 \uae4a\uac8c \uc911\ucca9\ub418\uba74 \ucf54\ub4dc\uac00 \ubcf5\uc7a1\ud574\uc9c8 \uc218 \uc788\uc74c<\/li>\n<li>\uc0c1\ud0dc \ubcc0\uacbd \ub85c\uc9c1\uc774 \ucef4\ud3ec\ub10c\ud2b8\uc5d0 \ubd84\uc0b0\ub418\uc5b4 \uad00\ub9ac\uac00 \uc5b4\ub824\uc6cc\uc9c8 \uc218 \uc788\uc74c<\/li>\n<\/ul>\n<h2>5. Context API\ub97c \ud65c\uc6a9\ud55c \ub9ac\ud329\ud1a0\ub9c1<\/h2>\n<p>\n            \uae30\uc874\uc758 Prop drilling\uc744 Context API\ub85c \ub9ac\ud329\ud1a0\ub9c1\ud558\uc5ec \uc0c1\ud0dc \uad00\ub9ac\ub97c \ub354 \uac04\ud3b8\ud558\uac8c \ub9cc\ub4dc\ub294 \ubc29\ubc95\uc744 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \uc774 \uc608\uc81c\uc5d0\uc11c\ub294 \uae4a\uc740 \uad6c\uc870\ub97c \uac00\uc9c4 \ucef4\ud3ec\ub10c\ud2b8\ub4e4\uc744 \uc11c\ub85c \uc5f0\uacb0\ud574\uc904 \ub54c Context API\uac00 \ud2b9\ud788 \uc720\uc6a9\ud569\ub2c8\ub2e4.\n        <\/p>\n<pre><code>\nconst App = () =&gt; {\n    const [theme, setTheme] = useState('light');\n\n    return (\n        <themecontext.provider settheme=\"\" theme,=\"\" value=\"{{\" }}=\"\">\n            <header><\/header>\n            <maincontent><\/maincontent>\n        <\/themecontext.provider>\n    );\n};\n\nconst Header = () =&gt; {\n    return (\n        <div>\n            <h1>\ub098\uc758 \ube14\ub85c\uadf8<\/h1>\n            <themetoggle><\/themetoggle>\n        <\/div>\n    );\n};\n\nconst ThemeToggle = () =&gt; {\n    const { theme, setTheme } = useContext(ThemeContext);\n\n    return (\n        <button ==\"\" onclick=\"{()\"> setTheme(theme === 'light' ? 'dark' : 'light')}&gt;\n            \ud14c\ub9c8 \ubcc0\uacbd\n        <\/button>\n    );\n};\n        <\/code><\/pre>\n<h2>\uacb0\ub860<\/h2>\n<p>\n            Context API\ub294 \ucef4\ud3ec\ub10c\ud2b8 \uac04\uc5d0 \uc804\uc5ed\uc801\uc73c\ub85c \ub370\uc774\ud130\ub97c \uacf5\uc720\ud560 \uc218 \uc788\uac8c \ud574\uc8fc\uba70, \uc0c1\ud0dc \uad00\ub9ac\uc758 \ubcf5\uc7a1\uc131\uc744 \uc904\uc774\uace0 \ucf54\ub4dc\uc758 \uac00\ub3c5\uc131\uc744 \ub192\uc785\ub2c8\ub2e4. \uac04\ub2e8\ud55c API\ub97c \ud1b5\ud574 \ud6a8\uc728\uc801\uc73c\ub85c \uc0c1\ud0dc\ub97c \uad00\ub9ac\ud560 \uc218 \uc788\uc73c\uba70, \ub2e4\uc591\ud55c \uc0c1\ud669\uc5d0\uc11c \uc720\uc6a9\ud558\uac8c \ud65c\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ud2b9\ud788 \ub300\uaddc\ubaa8 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c Context API\ub294 \ubcf5\uc7a1\ud55c \uc0c1\ud0dc\ub97c \ud6a8\uacfc\uc801\uc73c\ub85c \uad00\ub9ac\ud560 \uc218 \uc788\ub294 \ud6cc\ub96d\ud55c \ub3c4\uad6c\uc785\ub2c8\ub2e4.\n        <\/p>\n<p>\n            \uc55e\uc73c\ub85c \ub2e4\uc591\ud55c \uc0ac\ub840\ub97c \ud1b5\ud574 Context API\uc640 \uc804\uc5ed \uc0c1\ud0dc \uad00\ub9ac \uae30\uc220\uc744 \uc2ec\ud654\uc2dc\ucf1c \ub098\uac00\uae30\ub97c \ubc14\ub78d\ub2c8\ub2e4. \uc774\ub97c \ud1b5\ud574 \ub9ac\uc561\ud2b8 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc758 \uc131\ub2a5\uc744 \ucd5c\uc801\ud654\ud558\uace0 \uac00\ub3c5\uc131\uc744 \ub192\uc77c \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n        <\/p>\n<\/article>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ucd5c\uadfc Frontend \uac1c\ubc1c\uc5d0\uc11c \uc0c1\ud0dc \uad00\ub9ac \ub77c\uc774\ube0c\ub7ec\ub9ac\ub4e4\uc774 \ub9ce\uc774 \uc0ac\uc6a9\ud558\ub294\ub370, \uadf8 \uc911\uc5d0\uc11c\ub3c4 Redux, MobX\uc640 \uac19\uc740 \ub77c\uc774\ube0c\ub7ec\ub9ac\ub4e4\uc774 \ub9ce\uc774 \uc54c\ub824\uc838 \uc788\uc2b5\ub2c8\ub2e4. \ud558\uc9c0\ub9cc React \ud300\uc5d0\uc11c \uc81c\uacf5\ud558\ub294 Context API\ub97c \uc0ac\uc6a9\ud558\uba74, \ubcf5\uc7a1\ud55c \uc0c1\ud0dc \uad00\ub9ac\ub97c \uc27d\uac8c \uad6c\ud604\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. Context API\ub294 \uac04\ub2e8\ud55c API\ub97c \uc81c\uacf5\ud558\uba74\uc11c\ub3c4 \ub2e4\uc591\ud55c \uc0c1\ud0dc \uad00\ub9ac \uc2dc\ub098\ub9ac\uc624\ub97c \uc9c0\uc6d0\ud558\uc5ec \uac1c\ubc1c\uc790\ub4e4\uc774 \ubcf4\ub2e4 \ub354 \ud6a8\uc728\uc801\uc73c\ub85c \uc804\uc5ed \uc0c1\ud0dc\ub97c \uad00\ub9ac\ud560 \uc218 \uc788\ub3c4\ub85d \ub3c4\uc640\uc90d\ub2c8\ub2e4. 1. Context API \uae30\ubcf8 &hellip; <a href=\"https:\/\/atmokpo.com\/w\/38956\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;Context API\uc640 \uc804\uc5ed \uc0c1\ud0dc \uad00\ub9ac, \ub2e4\uc591\ud55c Context \uc608\uc81c\uc640 \ud65c\uc6a9\ubc95&#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-38956","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>Context API\uc640 \uc804\uc5ed \uc0c1\ud0dc \uad00\ub9ac, \ub2e4\uc591\ud55c Context \uc608\uc81c\uc640 \ud65c\uc6a9\ubc95 - \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\/38956\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Context API\uc640 \uc804\uc5ed \uc0c1\ud0dc \uad00\ub9ac, \ub2e4\uc591\ud55c Context \uc608\uc81c\uc640 \ud65c\uc6a9\ubc95 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"\ucd5c\uadfc Frontend \uac1c\ubc1c\uc5d0\uc11c \uc0c1\ud0dc \uad00\ub9ac \ub77c\uc774\ube0c\ub7ec\ub9ac\ub4e4\uc774 \ub9ce\uc774 \uc0ac\uc6a9\ud558\ub294\ub370, \uadf8 \uc911\uc5d0\uc11c\ub3c4 Redux, MobX\uc640 \uac19\uc740 \ub77c\uc774\ube0c\ub7ec\ub9ac\ub4e4\uc774 \ub9ce\uc774 \uc54c\ub824\uc838 \uc788\uc2b5\ub2c8\ub2e4. \ud558\uc9c0\ub9cc React \ud300\uc5d0\uc11c \uc81c\uacf5\ud558\ub294 Context API\ub97c \uc0ac\uc6a9\ud558\uba74, \ubcf5\uc7a1\ud55c \uc0c1\ud0dc \uad00\ub9ac\ub97c \uc27d\uac8c \uad6c\ud604\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. Context API\ub294 \uac04\ub2e8\ud55c API\ub97c \uc81c\uacf5\ud558\uba74\uc11c\ub3c4 \ub2e4\uc591\ud55c \uc0c1\ud0dc \uad00\ub9ac \uc2dc\ub098\ub9ac\uc624\ub97c \uc9c0\uc6d0\ud558\uc5ec \uac1c\ubc1c\uc790\ub4e4\uc774 \ubcf4\ub2e4 \ub354 \ud6a8\uc728\uc801\uc73c\ub85c \uc804\uc5ed \uc0c1\ud0dc\ub97c \uad00\ub9ac\ud560 \uc218 \uc788\ub3c4\ub85d \ub3c4\uc640\uc90d\ub2c8\ub2e4. 1. Context API \uae30\ubcf8 &hellip; \ub354 \ubcf4\uae30 &quot;Context API\uc640 \uc804\uc5ed \uc0c1\ud0dc \uad00\ub9ac, \ub2e4\uc591\ud55c Context \uc608\uc81c\uc640 \ud65c\uc6a9\ubc95&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/38956\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-02T02:35:53+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-26T06:42:49+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=\"1\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/atmokpo.com\/w\/38956\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38956\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"Context API\uc640 \uc804\uc5ed \uc0c1\ud0dc \uad00\ub9ac, \ub2e4\uc591\ud55c Context \uc608\uc81c\uc640 \ud65c\uc6a9\ubc95\",\"datePublished\":\"2024-11-02T02:35:53+00:00\",\"dateModified\":\"2024-11-26T06:42:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38956\/\"},\"wordCount\":66,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"React\ud504\ub860\ud2b8\uc5d4\ub4dc\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/38956\/\",\"url\":\"https:\/\/atmokpo.com\/w\/38956\/\",\"name\":\"Context API\uc640 \uc804\uc5ed \uc0c1\ud0dc \uad00\ub9ac, \ub2e4\uc591\ud55c Context \uc608\uc81c\uc640 \ud65c\uc6a9\ubc95 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-02T02:35:53+00:00\",\"dateModified\":\"2024-11-26T06:42:49+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38956\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/38956\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/38956\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Context API\uc640 \uc804\uc5ed \uc0c1\ud0dc \uad00\ub9ac, \ub2e4\uc591\ud55c Context \uc608\uc81c\uc640 \ud65c\uc6a9\ubc95\"}]},{\"@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":"Context API\uc640 \uc804\uc5ed \uc0c1\ud0dc \uad00\ub9ac, \ub2e4\uc591\ud55c Context \uc608\uc81c\uc640 \ud65c\uc6a9\ubc95 - \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\/38956\/","og_locale":"ko_KR","og_type":"article","og_title":"Context API\uc640 \uc804\uc5ed \uc0c1\ud0dc \uad00\ub9ac, \ub2e4\uc591\ud55c Context \uc608\uc81c\uc640 \ud65c\uc6a9\ubc95 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"\ucd5c\uadfc Frontend \uac1c\ubc1c\uc5d0\uc11c \uc0c1\ud0dc \uad00\ub9ac \ub77c\uc774\ube0c\ub7ec\ub9ac\ub4e4\uc774 \ub9ce\uc774 \uc0ac\uc6a9\ud558\ub294\ub370, \uadf8 \uc911\uc5d0\uc11c\ub3c4 Redux, MobX\uc640 \uac19\uc740 \ub77c\uc774\ube0c\ub7ec\ub9ac\ub4e4\uc774 \ub9ce\uc774 \uc54c\ub824\uc838 \uc788\uc2b5\ub2c8\ub2e4. \ud558\uc9c0\ub9cc React \ud300\uc5d0\uc11c \uc81c\uacf5\ud558\ub294 Context API\ub97c \uc0ac\uc6a9\ud558\uba74, \ubcf5\uc7a1\ud55c \uc0c1\ud0dc \uad00\ub9ac\ub97c \uc27d\uac8c \uad6c\ud604\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. Context API\ub294 \uac04\ub2e8\ud55c API\ub97c \uc81c\uacf5\ud558\uba74\uc11c\ub3c4 \ub2e4\uc591\ud55c \uc0c1\ud0dc \uad00\ub9ac \uc2dc\ub098\ub9ac\uc624\ub97c \uc9c0\uc6d0\ud558\uc5ec \uac1c\ubc1c\uc790\ub4e4\uc774 \ubcf4\ub2e4 \ub354 \ud6a8\uc728\uc801\uc73c\ub85c \uc804\uc5ed \uc0c1\ud0dc\ub97c \uad00\ub9ac\ud560 \uc218 \uc788\ub3c4\ub85d \ub3c4\uc640\uc90d\ub2c8\ub2e4. 1. Context API \uae30\ubcf8 &hellip; \ub354 \ubcf4\uae30 \"Context API\uc640 \uc804\uc5ed \uc0c1\ud0dc \uad00\ub9ac, \ub2e4\uc591\ud55c Context \uc608\uc81c\uc640 \ud65c\uc6a9\ubc95\"","og_url":"https:\/\/atmokpo.com\/w\/38956\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-02T02:35:53+00:00","article_modified_time":"2024-11-26T06:42:49+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":"1\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/atmokpo.com\/w\/38956\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/38956\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"Context API\uc640 \uc804\uc5ed \uc0c1\ud0dc \uad00\ub9ac, \ub2e4\uc591\ud55c Context \uc608\uc81c\uc640 \ud65c\uc6a9\ubc95","datePublished":"2024-11-02T02:35:53+00:00","dateModified":"2024-11-26T06:42:49+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/38956\/"},"wordCount":66,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["React\ud504\ub860\ud2b8\uc5d4\ub4dc"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/38956\/","url":"https:\/\/atmokpo.com\/w\/38956\/","name":"Context API\uc640 \uc804\uc5ed \uc0c1\ud0dc \uad00\ub9ac, \ub2e4\uc591\ud55c Context \uc608\uc81c\uc640 \ud65c\uc6a9\ubc95 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-02T02:35:53+00:00","dateModified":"2024-11-26T06:42:49+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/38956\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/38956\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/38956\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"Context API\uc640 \uc804\uc5ed \uc0c1\ud0dc \uad00\ub9ac, \ub2e4\uc591\ud55c Context \uc608\uc81c\uc640 \ud65c\uc6a9\ubc95"}]},{"@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\/38956","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=38956"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38956\/revisions"}],"predecessor-version":[{"id":38957,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38956\/revisions\/38957"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=38956"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=38956"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=38956"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}