본문으로 건너뛰기
Skillpedia
웹사이트 및 UI (프런트엔드)40k · #7390

react19-source-patterns

하는 일

이 가이드는 React 19에 맞게 React 코드를 업데이트하도록 돕습니다. 새 버전에서 작동을 멈췄거나 위치가 바뀐 코드 부분을 어떻게 바꿀지 보여 줍니다.

사용하는 경우

  • ✓React 프로젝트를 버전 19로 업데이트할 때.
  • ✓업데이트 후 React 코드의 일부가 작동하지 않을 때.
  • ✓특정 파일에 필요한 변경 사항을 이해하고 싶을 때.

스킬 링크

https://github.com/github/awesome-copilot/blob/main/skills/react19-source-patterns/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/github/awesome-copilot/blob/main/skills/react19-source-patterns/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“React 19를 위해 ReactDOM.render를 어떻게 업데이트하나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

AI는 기존 코드를 React 19의 마이그레이션 패턴과 비교합니다. 각 코드 부분에 필요한 정확한 변경을 제안합니다. 예를 들어 ReactDOM.render를 createRoot().render()로 바꾸는 식입니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

React 19 Source Migration Patterns

Reference for every source-file migration required for React 19.

Quick Reference Table

Pattern Action Reference
ReactDOM.render(...) → createRoot().render() See references/api-migrations.md
ReactDOM.hydrate(...) → hydrateRoot(...) See references/api-migrations.md
unmountComponentAtNode → root.unmount() Inline fix
ReactDOM.findDOMNode → direct ref Inline fix
forwardRef(...) wrapper → ref as direct prop See references/api-migrations.md
Component.defaultProps = {} → ES6 default params See references/api-migrations.md
useRef() no arg → useRef(null) Inline fix add null
Legacy Context → createContext → api-migrations.md#legacy-context
String refs this.refs.x → createRef() → api-migrations.md#string-refs
import React from 'react' (unused) Remove Only if no React. usage in file

PropTypes Rule

Do not remove .propTypes assignments. The prop-types package still works as a standalone validator. React 19 only removes the built-in runtime checking from the React package the package itself remains valid.

Add this comment above any .propTypes block:

// NOTE: React 19 no longer runs propTypes validation at runtime.
// PropTypes kept for documentation and IDE tooling only.

Read the Reference

For full before/after code for each migration, read references/api-migrations.md. It contains the complete patterns including edge cases for forwardRef with useImperativeHandle, defaultProps null vs undefined behavior, and legacy context provider/consumer cross-file migrations.

자주 묻는 질문

propTypes를 제거해야 하나요?

아니요, 제거할 필요가 없습니다. 여전히 검증기로 작동하지만, React 19는 더 이상 자동으로 실행하지 않습니다. 문서화와 도구 지원을 위해 유지하는 것이 좋습니다.

'문자열 ref'는 무엇인가요?

React에서 요소를 참조하는 오래된 방식입니다(예: this.refs.myElement). React 19는 대신 createRef()를 쓰도록 권장합니다.

초기값 없이 useRef()를 쓰면 어떻게 하나요?

React 19는 인수로 null을 추가하도록 요청합니다. 즉 useRef(null)로 써야 합니다.

상세 정보

작성자의 원본 설명

Reference for React 19 source-file migration patterns, including API changes, ref handling, and context updates.

repo: github/awesome-copilot

인기도

GitHub 스타
40k
순위
#7390
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬