← 문제 목록
초급
React
30P
React Component Lifecycle은?
React 컴포넌트는 생명 주기 동안 여러 상태를 가집니다. 이 생명 주기는 Mounting, Updating, Unmounting으로 나눌 수 있습니다. Mounting 단계에서 실행되는 메서드 중 하나는 무엇인가요? 아래의 코드에서는 각 단계에 대한 설명이 포함되어 있습니다.
위의 코드에서 Mounting 단계에서 호출되는 메서드는 무엇일까요?
위의 코드에서 Mounting 단계에서 호출되는 메서드는 무엇일까요?
JAVASCRIPT
class MyComponent extends React.Component {
constructor(props) {
super(props);
this.state = { count: 0 };
}
componentDidMount() {
// 컴포넌트가 마운트된 후 호출됩니다.
}
render() {
return <div>{this.state.count}</div>;
}
}
0명 풀이 · 정답률 0%