React hook use useEffect as useState callback

`useState` doesn't have callback function and it's asynchronous, so if we need to monitor when the state got changed, we need to combine ...

Wayne

react functional setState

```js this.setState((prevState, props) => ( { hello: "world" } )) ``` 這是很重要的,不然 setState 有可能會一起執行,變成 Object.assign({}, {hello: "world...

Wayne

React stateless component

幾個重點 1. 可以不用使用 ES6 的 class 2. State 不存在 presentational component 裡面,變成 pure function,沒有 react lifecycle 3. 沒有 react lifecycle 代表不能快速 ha...

Wayne