In addition to Hooks and Components, the react package exports a few other APIs that are useful for defining components. This page lists all the remaining modern React APIs.
react 패키지는 훅과 컴포넌트 외에도 컴포넌트를 정의하는 데 유용한 몇 가지 다른 API를 제공합니다. 이 페이지에는 나머지 모든 최신 React API를 나열하였습니다.
-
createContextlets you define and provide context to the child components. Used withuseContext.createContext를 사용하면 하위 컴포넌트에 컨텍스트를 정의하고 제공할 수 있습니다.useContext와 함께 사용됩니다. -
forwardReflets your component expose a DOM node as a ref to the parent. Used withuseRef.forwardRef를 사용하면 컴포넌트가 부모에 대한 참조로 DOM 노드를 노출할 수 있습니다.useRef와 함께 사용됩니다. -
lazylets you defer loading a component’s code until it’s rendered for the first time.lazy를 사용하면 컴포넌트가 처음 렌더링될 때까지 코드 로드를 지연시킬 수 있습니다. -
memolets your component skip re-renders with same props. Used withuseMemoanduseCallback.memo를 사용하면 컴포넌트가 동일한 props로 리렌더링하는 것을 건너뛸 수 있습니다.useMemo및useCallback과 함께 사용됩니다. -
startTransitionlets you mark a state update as non-urgent. Similar touseTransition.startTransition을 사용하면 state 업데이트를 긴급하지 않은 것으로 표시할 수 있습니다.useTransition과 유사합니다.