Skip to content

Commit 76f8374

Browse files
authored
Officially document TS support (#5158)
1 parent 8a020ec commit 76f8374

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

docs/introduction/getting-started.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,24 @@ yarn add react-redux
8787

8888
The package includes a precompiled ESM build that can be used as a [`<script type="module">` tag](https://unpkg.com/@reduxjs/toolkit/dist/redux-toolkit.browser.mjs) directly in the browser.
8989

90+
## Requirements
91+
92+
### TypeScript
93+
94+
Redux Toolkit follows [DefinitelyTyped's policy](https://github.com/DefinitelyTyped/DefinitelyTyped#support-window) of supporting TypeScript versions released within the past two years. As of RTK 2.11, this means we support:
95+
96+
| RTK Version | Minimum TypeScript |
97+
| ----------- | ------------------ |
98+
| 2.x | 5.4+ |
99+
| 1.9.x | 4.7+ |
100+
101+
<details>
102+
<summary>Using an older TypeScript version?</summary>
103+
104+
If you're unable to upgrade TypeScript, RTK may still work with older versions, but you may encounter type errors or missing type inference. We strongly recommend upgrading to take advantage of improved type safety and developer experience.
105+
106+
</details>
107+
90108
## What's Included
91109

92110
Redux Toolkit includes these APIs:

docs/rtk-query/usage-with-typescript.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ This page provides details for using APIs included in RTK Query with TypeScript
2424

2525
:::info
2626

27-
**We strongly recommend using TypeScript 4.1+ with RTK Query for best results.**
27+
RTK Query [supports TS versions released within the last 2 years](../usage/usage-with-typescript.md).
2828

2929
If you encounter any problems with the types that are not described on this page, please [open an issue](https://github.com/reduxjs/redux-toolkit/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc) for discussion.
3030

docs/usage/usage-with-typescript.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,24 @@ If you encounter any problems with the types that are not described on this page
2929

3030
:::
3131

32+
:::tip TypeScript Version Requirement
33+
34+
Redux Toolkit follows [DefinitelyTyped's policy](https://github.com/DefinitelyTyped/DefinitelyTyped#support-window) of supporting TypeScript versions released within the past two years. As of RTK 2.11, this means we support:
35+
36+
| RTK Version | Minimum TypeScript |
37+
| ----------- | ------------------ |
38+
| 2.x | 5.4+ |
39+
| 1.9.x | 4.7+ |
40+
41+
<details>
42+
<summary>Using an older TypeScript version?</summary>
43+
44+
If you're unable to upgrade TypeScript, RTK may still work with older versions, but you may encounter type errors or missing type inference. We strongly recommend upgrading to take advantage of improved type safety and developer experience.
45+
46+
</details>
47+
48+
:::
49+
3250
## `configureStore`
3351

3452
The basics of using `configureStore` are shown in [TypeScript Quick Start tutorial page](../tutorials/typescript.md). Here are some additional details that you might find useful.

0 commit comments

Comments
 (0)