일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- 리액트
- node
- 시퀄라이즈
- NPM
- 리액트컴포넌트
- React Component
- MongoDB
- 클래스컴포넌트
- npm명령어
- React
- nodeJS
- nodejs교과서
- 리액트기초
- component
- express-generator
- 제로초예제
- sequelize
- mongoose
- mongo
- NoSQL
- sementicversion
- 리액트스타디
- 시퀄라이즈공부
- Today
- Total
목록제로초예제 (2)
개발노트

리액트의 라이프 사이클 render 함수가 실행되면 DOM에 (render)함수를 붙여주는데 붙여주고난 그 순간에 이벤트잡아서 원하는 설정이 가능함 그게 componentDidMount, 컴포넌트가 첫 렌더링 된 후 componentDidMount -비동기 요청 컴포넌트가 제거되기 직전 componentWillUnmount (부모컴포넌트가 자식컴포넌트 없앴을때 자식이컴포넌트가 없어지기(unmount)전에 실행됨) 리렌더링후에 실행 componentDidUpdate -비동기 요청의 삭제 (컴포넌트를 삭제해도 만약 setInterval을 걸었을 경우 계속실행됨) 클래스컴포넌트 constructor state부분 render (ref) componentDidMount setState/부모가props바꿀때 ->..
Rready상태 -> (클릭) -> 게임시작 기다려 상태 -> ( 2~3초 후 ) 클릭해 상태 -> (클릭) -> 반응속도를 체크! 1. 기본 state, if 만들기 import React ,{Component} from 'react'; class ResponseCheck extends Component{ state={ color:'waiting', message:'클릭해서 시작', result:[], } onClickScreen = ()=>{ const { color, result, message } = this.state; if( color === 'waiting'){// waiting일때 클릭을 한 경우 this.setState({ color:'ready', message:'초록색이되면 클릭하세요..