onClick={function(e){ //내용 }}
e.preventDefault();
this.setState({ 현재 변경할 상태 : '변경하고 싶은 상태' });
this.state.현재 변경할 상태 = '변경하고 싶은 상태'
이렇게 하면 리액트가 알 수 없음
function 이름(){ //내용 }.bind(변수이름)
이렇게 지정하면 변수를 function안에서 this로 사용가능해진다.
bind(this)하면 본인 클래스의 변수를 함수 안에서 this로 사용가능
App컴포넌트에서 Hello컴포넌트로 값 전달하기 :
App.js
<Hello name="전달내용" /> //Hello로 name이 전달 되는거임
Hello.js
{props.name} or function Hello(props)
페이지가 바꼈을 때 호출됨
<Hello onChangePage={function(){ //페이지가 바꼈을 때 function이 수행됨 this.setState({mode:'welcome'}); }.bind(this)}