reactContext 썸네일형 리스트형 비전공자의 공부일지 - reactContext 1. reactContext 지금까지 데이터를 보관하거나 자식요소에게 보내는 방식으로 state, props를 사용했는데 이번에는 reactContext를 사용해서 해보려고 한다. reactContext는 props, state와 다르게 reactContext의 태그에 value값을 준 상태에서 자식요소들에서 따로 선언을 해주지 않아도 바로 사용할 수 있다. import { createContext, useContext } from 'react'; const ThemeContext = createContext(null); export default function MyApp() { return ( ) } const theme = useContext(ThemeContext); ThemeContext라는 이.. 더보기 이전 1 다음