커리어리 트렌드

현직자 Q&A채용공고커리어 에이전트New

#contextprovider

질문 1
해시태그 없이 키워드만 일치하는 질문은 개수에 포함되지 않아요.

일 년 전 · 우엉김밥 님의 새로운 댓글

리액트 context api

* ContextProvider 정의* const LocationContext = createContext() export const LocationProvider = ({children})=> return ( <LocationContext.Provider value={contextValue}> {children} </LocationContext.Provider> ); }; --------------------------- asd.jsx <ContextProvider> <A/> </ContextProvider> ---------------------- qwe.jsx <ContextProvider> <B/> </ContextProvider> ---------------------------------- 이런식으로 작성했을때 A컴포넌트에서 컨택스트 내부 값을 변경하면 B컴포넌트가 재 랜더링 되나요? (되는줄 알았는데 안돼서요..ㅠ)

개발자

#react

#context

답변 1

댓글 1

조회 52