From 65ba3e87e49f7ea1bac04e1ed938debdbafcf30a Mon Sep 17 00:00:00 2001 From: Eng Zer Jun Date: Fri, 6 Dec 2024 23:12:38 +0800 Subject: [PATCH] docs: use diff codeblock for `useReducer` typings change (#31685) ## Summary This PR updates the 19.0.0 changelog to use diff-styled code blocks for illustrating changes to `useReducer` typings. Also removes the incorrect square brackets in the second diff, it should be `Action` instead of `[Action]`. ## How did you test this change? **Before** ![2024-12-06_10-49](https://github.com/user-attachments/assets/bde94eec-a7cc-4fc8-bcca-37867633d37e) **After** ![2024-12-06_10-51](https://github.com/user-attachments/assets/693fb7ac-68a3-45fc-aada-0c7594441b2a) Signed-off-by: Eng Zer Jun --- CHANGELOG.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b8fda5941314e..5ec024416d5b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -97,11 +97,15 @@ The most common changes can be codemodded with `npx types-react-codemod@latest p * JSX namespace in TypeScript: The global `JSX` namespace is removed to improve interoperability with other libraries using JSX. Instead, the JSX namespace is available from the React package: `import { JSX } from 'react'` * Better `useReducer` typings: Most `useReducer` usage should not require explicit type arguments. For example, - \-useReducer\\>(reducer) - \+useReducer(reducer) - or - \-useReducer\\>(reducer) - \+useReducer\(reducer) + ```diff + -useReducer>(reducer) + +useReducer(reducer) + ``` + or + ```diff + -useReducer>(reducer) + +useReducer(reducer) + ``` ## All Changes