TypeScript

    Context ์— Class ๋‹ด๊ธฐ

    wow.. ์•Œ๊ณ  ๋‚˜๋‹ˆ ์ •๋ง ๋‹น์—ฐํ•œ ๊ฑด๋ฐ, ํด๋ž˜์Šค๋ฅผ ์–ด๋–ป๊ฒŒ ์ œ๋„ค๋ฆญ์— ๋‹ด๊ณ  ์ดˆ๊ธฐ๊ฐ’์„ ์ค˜์•ผ ํ• ์ง€ 1์‹œ๊ฐ„ ๊ฐ€๊นŒ์ด ํ—ค๋งธ๋‹ค ใ… ใ… ใ… ใ…  ํœด ํƒ€์Šค๋Š” ์ต์ˆ™ํ•ด์ง€๋ ค๊ณ  ํ•˜๋ฉด ์–ด๋Š ์„ผ๊ฐ€ ์ € ๋ฉ€๋ฆฌ ์žˆ์–ด.. import React, { createContext, useContext } from 'react'; import Youtube from '../apis/youtube'; export const youtube = new Youtube(); const YoutubeApiContext = createContext({ youtube }); interface Props { children: React.ReactElement; } export function YoutubeApiProvider({ children }: Props) { r..