https://github.com/facebook/react/releases/tag/v16.8.0
https://github.com/facebook/react/releases/tag/v16.8.1
v16.8.0
React
- Hooksの追加
- Hooksの
useReducerのlazy initialization APIを改善
React DOM
-
useState/useReducerで同一値の再レンダリングを回避 -
useState/useReducerの値の比較にObject.isを利用 -
useEffect/useMemo/useCallbackで最初に渡された引数を比較しない -
React.lazy()にsynchronous thenablesをサポート - strict-modeのHooksでコンポーネントを2回レンダリングするように
- 開発モードでHooksの順序に対して警告を出すように
- cleanup関数はundefinedを必ず返すように(その他の値やnullは禁止)
React Test Renderer and Test Utils
- shallowレンダリングでHooksをサポート
- shallowレンダリング時に
getDerivedStateFromPropsがあるときのshouldComponentUpdate内の誤った状態を修正 - テストが実際の動作とより厳密に一致するよう、バッチ処理のための
ReactTestRenderer.act()およびReactTestUtils.act()を追加
ESLint Plugin: React Hooks
- 初回リリース
- ループが発生した際のレポート機能を追加
- throwingをルール違反とみなさないように
v16.8.1
React DOM and React Test Renderer
- 古いバージョンのReactと同時に利用した際にクラッシュする問題を修正
React Test Utils
- Node環境でクラッシュする問題を修正