Props
2020. 4. 12.
class를 생성할 때 this.props라는 표현이 있었다. (2020/04/11 - React (2) - Component) 1 2 3 4 5 6 7 8 9 10 11 // function형 function Welcome(props) { return Hello, {props.name}; } // class형 class Welcome extends React.Component { render() { return Hello, {this.props.name}; } } Colored by Color Scripter cs props는 property의 줄임말로 함수에서 parameter로 해당 attribute를 받아 사용할 수 있다. .(점)으로 속성명에 접근이 가능하고, props.속성명으로 속성 값을 가..