
React - 17.1. 컴포넌트 이벤트 만들기 return ( { {this.state.subject.title} {this.state.subject.sub} */} ); - header 태그를 주석처리하고 원래 쓰던 태그 살림 - 이벤트 처리를 하고 싶다면 onChangePage 이벤트를 쓸 수 있음 - a 태그가 클릭되었을 때 설치한 함수를 실행해 줌 - 우리가 만드려고 하는 Subject 컴포넌트는 onChangePage 이벤트가 있어서 이 컴포넌트 안에서 링크를 클릭했을 때 이벤트에 설치한 함수를 만드려고 함 - App.js에 추가 - onChangePage {this.props.title} {this.props.sub} - Subject.js에 추가 - 링크 태그에 onClick 속성 추가해주..

React - 12. props class TOC extends Component{ render(){ return( HTML CSS JavaScript ); } } - link 태그에는 a라는 것을 통해 이것이 태그라는 것을 알려줌 - 이것이 어떤 주소랑 연결되는지 알려줄 필요가 있음 - href="1.html" ➡ 태그의 속성(attribute)를 통해 알 수 있음 ➡ 위처럼 title과 sub title을 통해서 구별할 수 있다면 얼마나 좋을까? class Subject extends Component { render(){ return ( {this.props.title} {this.props.sub} ); } } class App extends Component { render() { return ..