반응형
Both signatures can be used, the only difference is that if you need to change your state based on the previous state you should use this.setState(function) which will provide for you a snapshot(prevState) from the previous state. But if the change does not rely on any other previous value, than a shorter version is recommended this.setState({prop: newValue})this.setState(prevState =>{ return{ ...prevState, counter : prevState.counter +1 } }) this.setState({counter : 2})
- promise / 비동기 동기 헷갈리는 것
- try catch
- async await
- call back..
- article collector 하면서 시간 많이 걸린 부분 정리
반응형
댓글