소스 정보
- 저장소
- cockroachdb/cockroach
- 최근 소스 활동
- 2026년 2월 10일 18:22
- 감지된 SKILL.md 언어
- 영어
- 스타
- 32,393
- 포크
- 4,089
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/cockroachdb/cockroach --skill react-class-to-functional명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | react-class-to-functional |
| description | Convert React class components to functional components with hooks |
| argument-hint | <file-path> |
Convert the React class component at $ARGUMENTS to a functional component using React hooks.
this.state = { ... } → individual useState hooksthis.setState({ key: value }) → setter functionthis.setState(prev => ...) → functional update formsetExpandedRows(prev => { const next = new Set(prev); next.add(key); return next; });
| Class | Functional |
|---|---|
componentDidMount | useEffect(fn, []) |
componentDidUpdate | useEffect(fn) or useEffect(fn, [deps]) |
componentWillUnmount | useEffect(() => cleanup, []) |
| mount + unmount | single useEffect with cleanup return |
React.createRef() → useRef(null)static contextType → useContext(MyContext)this.timer) → useRefcreateSelector (reselect) → useMemo with explicit dependency arraythis.props.x → destructured propsstatic defaultProps → default parameter values?) in the interface:
interface Props { sortSetting?: SortSetting; }
function Component({ sortSetting = defaultValue }: Props) { ... }
this.setState(update, callback) has no direct hook equivalent. Use ref + useEffect:
const pendingRef = useRef(false);
const prevRef = useRef(value);
const onUpdate = useCallback(() => {
pendingRef.current = true;
setValue(newValue);
}, []);
useEffect(() => {
if (pendingRef.current && prevRef.current !== value) {
pendingRef.current = false;
doCallback();
}
prevRef.current = value;
}, [value, doCallback]);
class MyTable extends SortedTable<Row> {} → const MyTable = SortedTable<Row>;<SortedTable<Row> {...props} />this. references removeduseCallback is actually called)package.json, run ESLint (fix) and Tests