From fcd00068bd1bdd4eb37e3e0ab0488a9d093670bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xuan=20Huang=20=28=E9=BB=84=E7=8E=84=29?= Date: Fri, 10 Nov 2023 21:57:45 +0800 Subject: [PATCH] Capitalize word "Hook" (#6424) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary of changes: See . There is one exception though. The error message “Rendered fewer hooks than expected” from React is indeed "hooks" so I kept as-is. Shall we change the error message from React? Co-authored-by: xuan.huang --- .../blog/2022/03/08/react-18-upgrade-guide.md | 4 ++-- src/content/blog/2022/03/29/react-v18.md | 11 +++++----- ...-what-we-have-been-working-on-june-2022.md | 2 +- ...what-we-have-been-working-on-march-2023.md | 2 +- src/content/learn/typescript.md | 20 +++++++++---------- src/content/reference/react/use-client.md | 2 +- 6 files changed, 20 insertions(+), 21 deletions(-) diff --git a/src/content/blog/2022/03/08/react-18-upgrade-guide.md b/src/content/blog/2022/03/08/react-18-upgrade-guide.md index 29ba0b71d..66da896ec 100644 --- a/src/content/blog/2022/03/08/react-18-upgrade-guide.md +++ b/src/content/blog/2022/03/08/react-18-upgrade-guide.md @@ -224,8 +224,8 @@ For more information, see the [Automatic batching deep dive](https://github.com/ In the React 18 Working Group we worked with library maintainers to create new APIs needed to support concurrent rendering for use cases specific to their use case in areas like styles, and external stores. To support React 18, some libraries may need to switch to one of the following APIs: -* `useSyncExternalStore` is a new hook that allows external stores to support concurrent reads by forcing updates to the store to be synchronous. This new API is recommended for any library that integrates with state external to React. For more information, see the [useSyncExternalStore overview post](https://github.com/reactwg/react-18/discussions/70) and [useSyncExternalStore API details](https://github.com/reactwg/react-18/discussions/86). -* `useInsertionEffect` is a new hook that allows CSS-in-JS libraries to address performance issues of injecting styles in render. Unless you've already built a CSS-in-JS library we don't expect you to ever use this. This hook will run after the DOM is mutated, but before layout effects read the new layout. This solves an issue that already exists in React 17 and below, but is even more important in React 18 because React yields to the browser during concurrent rendering, giving it a chance to recalculate layout. For more information, see the [Library Upgrade Guide for `