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**  **After**  Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Eng Zer Jun committed
Dec 6, 2024 at 23:12 UTC
65ba3e87e49f7ea1bac04e1ed938debdbafcf30a
1 file changed
+9
-5
CHANGELOG.md
+9
-5
@@ -97,11 +97,15 @@ The most common changes can be codemodded with `npx types-react-codemod@latest p
97
* 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'`
98
* Better `useReducer` typings: Most `useReducer` usage should not require explicit type arguments.
99
For example,
100
- \-useReducer\<React.Reducer\<State, Action\>\>(reducer)
101
- \+useReducer(reducer)
102
- or
103
- \-useReducer\<React.Reducer\<State, Action\>\>(reducer)
104
- \+useReducer\<State, \[Action\]\>(reducer)
100
+ ```diff
101
+ -useReducer<React.Reducer<State, Action>>(reducer)
102
+ +useReducer(reducer)
103
+ ```
104
+ or
105
+ ```diff
106
+ -useReducer<React.Reducer<State, Action>>(reducer)
107
+ +useReducer<State, Action>(reducer)
108
+ ```
109
110
111
## All Changes