Built-in React APIs

번역:이나령

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를 나열하였습니다.


  • createContext lets you define and provide context to the child components. Used with useContext. createContext를 사용하면 하위 컴포넌트에 컨텍스트를 정의하고 제공할 수 있습니다. useContext와 함께 사용됩니다.

  • forwardRef lets your component expose a DOM node as a ref to the parent. Used with useRef. forwardRef를 사용하면 컴포넌트가 부모에 대한 참조로 DOM 노드를 노출할 수 있습니다. useRef와 함께 사용됩니다.

  • lazy lets you defer loading a component’s code until it’s rendered for the first time. lazy를 사용하면 컴포넌트가 처음 렌더링될 때까지 코드 로드를 지연시킬 수 있습니다.

  • memo lets your component skip re-renders with same props. Used with useMemo and useCallback. memo를 사용하면 컴포넌트가 동일한 props로 리렌더링하는 것을 건너뛸 수 있습니다. useMemouseCallback과 함께 사용됩니다.

  • startTransition lets you mark a state update as non-urgent. Similar to useTransition. startTransition을 사용하면 state 업데이트를 긴급하지 않은 것으로 표시할 수 있습니다. useTransition과 유사합니다.