Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
node: ['22.x']
node: ['24.x']

steps:
- name: Checkout code
Expand Down Expand Up @@ -54,8 +54,8 @@ jobs:
strategy:
fail-fast: false
matrix:
node: ['22.x']
ts: ['5.0', '5.1', '5.2', '5.3', '5.4', '5.5', '5.6', '5.7', '5.8']
node: ['24.x']
ts: ['5.5', '5.6', '5.7', '5.8', '5.9', '6.0']
react:
[
{
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: ['22.x']
node: ['24.x']
steps:
- name: Checkout repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: ['22.x']
node: ['24.x']
example:
[
'cra4',
Expand All @@ -178,7 +178,7 @@ jobs:
- name: Clone RTK repo (pinned to known-good commit)
run: |
git init ./redux-toolkit
git -C ./redux-toolkit fetch --depth 1 https://github.com/reduxjs/redux-toolkit.git 576a02f8056fbee2dcaddb4d2e4d2da3b7937c58
git -C ./redux-toolkit fetch --depth 1 https://github.com/reduxjs/redux-toolkit.git d974a4d252090eab9e029842042757bc43af8980
git -C ./redux-toolkit checkout FETCH_HEAD

- name: Cache example deps
Expand Down Expand Up @@ -236,7 +236,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: ['22.x']
node: ['24.x']
example: ['rr-rsc-context']
defaults:
run:
Expand Down Expand Up @@ -283,7 +283,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: ['22.x']
node: ['24.x']
react:
[
{
Expand Down
3 changes: 2 additions & 1 deletion docs/tutorials/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ All generated actions should be defined using the `PayloadAction<T>` type from R
You can safely import the `RootState` type from the store file here. It's a circular import, but the TypeScript compiler can correctly handle that for types. This may be needed for use cases like writing selector functions.

```ts title="features/counter/counterSlice.ts"
import { createSlice, PayloadAction } from '@reduxjs/toolkit'
import type { PayloadAction } from '@reduxjs/toolkit'
import { createSlice } from '@reduxjs/toolkit'
import type { RootState } from '../../app/store'

// highlight-start
Expand Down
3 changes: 2 additions & 1 deletion docs/using-react-redux/usage-with-typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ const dispatch: AppDispatch = useDispatch()
The package includes a helper type, `ConnectedProps`, that can extract the return types of `mapStateToProps` and `mapDispatchToProps` from the first function. This means that if you split the `connect` call into two steps, all of the "props from Redux" can be inferred automatically without having to write them by hand. While this approach may feel unusual if you've been using React-Redux for a while, it does simplify the type declarations considerably.

```ts
import { connect, ConnectedProps } from 'react-redux'
import type { ConnectedProps } from 'react-redux'
import { connect } from 'react-redux'

interface RootState {
isOn: boolean
Expand Down
4 changes: 2 additions & 2 deletions examples/publish-ci/rr-rsc-context/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"@types/node": "20.3.0",
"@types/react": "18.2.12",
"@types/react-dom": "18.2.5",
"next": "13.4.5",
"next": "^16.2.9",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-redux": "^8.0.7",
"typescript": "5.1.3"
"typescript": "^6.0.3"
}
}
54 changes: 38 additions & 16 deletions examples/publish-ci/rr-rsc-context/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,50 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowArbitraryExtensions": true,
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"allowSyntheticDefaultImports": true,
"checkJs": true,
"declaration": true,
"declarationMap": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"forceConsistentCasingInFileNames": true,
"incremental": true,
"isolatedModules": true,
"jsx": "react-jsx",
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"module": "esnext",
"moduleDetection": "force",
"moduleResolution": "bundler",
"noEmit": true,
"noEmitOnError": true,
"noErrorTruncation": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
"outDir": "./dist",
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./*"]
}
"resolveJsonModule": true,
"rootDir": "./",
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"target": "esnext",
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.tsbuildinfo",
"types": ["node"],
"useDefineForClassFields": true,
"useUnknownInCatchVariables": true,
"verbatimModuleSyntax": true
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
"exclude": ["node_modules", "dist"],
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
".next/dev/types/**/*.ts",
"**/*.mts"
]
}
Loading
Loading