Skip to content

Commit c089964

Browse files
authored
Merge pull request #2316 from reduxjs/feat/switch-to-native-NoInfer
feat!: switch to native `NoInfer` utility type
2 parents b74ae3a + c7ef538 commit c089964

3 files changed

Lines changed: 13 additions & 19 deletions

File tree

.github/workflows/test.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
node: ['22.x']
15+
node: ['24.x']
1616

1717
steps:
1818
- name: Checkout code
@@ -54,8 +54,8 @@ jobs:
5454
strategy:
5555
fail-fast: false
5656
matrix:
57-
node: ['22.x']
58-
ts: ['5.0', '5.1', '5.2', '5.3', '5.4', '5.5', '5.6', '5.7', '5.8']
57+
node: ['24.x']
58+
ts: ['5.5', '5.6', '5.7', '5.8']
5959
react:
6060
[
6161
{
@@ -118,7 +118,7 @@ jobs:
118118
strategy:
119119
fail-fast: false
120120
matrix:
121-
node: ['22.x']
121+
node: ['24.x']
122122
steps:
123123
- name: Checkout repo
124124
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -151,7 +151,7 @@ jobs:
151151
strategy:
152152
fail-fast: false
153153
matrix:
154-
node: ['22.x']
154+
node: ['24.x']
155155
example:
156156
[
157157
'cra4',
@@ -178,7 +178,7 @@ jobs:
178178
- name: Clone RTK repo (pinned to known-good commit)
179179
run: |
180180
git init ./redux-toolkit
181-
git -C ./redux-toolkit fetch --depth 1 https://github.com/reduxjs/redux-toolkit.git 576a02f8056fbee2dcaddb4d2e4d2da3b7937c58
181+
git -C ./redux-toolkit fetch --depth 1 https://github.com/reduxjs/redux-toolkit.git d974a4d252090eab9e029842042757bc43af8980
182182
git -C ./redux-toolkit checkout FETCH_HEAD
183183
184184
- name: Cache example deps
@@ -236,7 +236,7 @@ jobs:
236236
strategy:
237237
fail-fast: false
238238
matrix:
239-
node: ['22.x']
239+
node: ['24.x']
240240
example: ['rr-rsc-context']
241241
defaults:
242242
run:
@@ -283,7 +283,7 @@ jobs:
283283
strategy:
284284
fail-fast: false
285285
matrix:
286-
node: ['22.x']
286+
node: ['24.x']
287287
react:
288288
[
289289
{

src/hooks/useSelector.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//import * as React from 'react'
2-
import { React } from '../utils/react'
32
import { useSyncExternalStoreWithSelector } from 'use-sync-external-store/with-selector.js'
43
import type { ReactReduxContextValue } from '../components/Context'
54
import { ReactReduxContext } from '../components/Context'
6-
import type { EqualityFn, NoInfer } from '../types'
5+
import type { EqualityFn } from '../types'
6+
import { React } from '../utils/react'
77
import {
88
createReduxContextHook,
99
useReduxContext as useDefaultReduxContext,

src/types.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,10 @@ import type {
55
FunctionComponent,
66
JSX,
77
} from 'react'
8-
9-
import type { Action, UnknownAction, Dispatch } from 'redux'
10-
11-
import type { NonReactStatics } from './utils/hoistStatics'
12-
8+
import type { Action, Dispatch, UnknownAction } from 'redux'
139
import type { ConnectProps } from './components/connect'
14-
1510
import type { UseSelectorOptions } from './hooks/useSelector'
11+
import type { NonReactStatics } from './utils/hoistStatics'
1612

1713
export type FixTypeLater = any
1814

@@ -169,12 +165,10 @@ export type ResolveThunks<TDispatchProps> = TDispatchProps extends {
169165
export interface TypedUseSelectorHook<TState> {
170166
<TSelected>(
171167
selector: (state: TState) => TSelected,
172-
equalityFn?: EqualityFn<NoInfer<TSelected>>,
168+
equalityFn?: EqualityFn<TSelected>,
173169
): TSelected
174170
<Selected = unknown>(
175171
selector: (state: TState) => Selected,
176172
options?: UseSelectorOptions<Selected>,
177173
): Selected
178174
}
179-
180-
export type NoInfer<T> = [T][T extends any ? 0 : never]

0 commit comments

Comments
 (0)