Rematch实践指南
  • 重新思考Redux
  • 目的
  • API 文档
    • @rematch/core API
    • Init Redux API
    • Plugin API
  • 技巧
    • Devtools
    • React
    • Vue
    • Testing
    • TypeScript
    • Immer
    • Decoupling reducers
  • 插件
    • Rematch Select
    • Rematch Loading
    • Rematch Persist
    • Rematch Updated
    • React Navigation
    • Rematch Immer
  • 灵感
Powered by GitBook
On this page
  • Examples
  • Changes
  • Dependencies
  • 确信Redux@3.x没有被依赖。
  1. 技巧

TypeScript

Examples

  • Counter

Changes

Rematch 能与 Typescript 一起工作,使用如下更改:

关闭noImplicitThis

Rematch 经常指定this上下文,导致 TS 错误。

你可以在你的tsconfig.json中指定noImplicitThis 关闭这些。

tsconfig.json

{
  "compilerOptions": {
    "noImplicitThis": false,
  }
}

Dependencies

确信Redux@3.x没有被依赖。

Rematch 依赖 Redux@4.x,它是Redux的一个分支,使用泛型处理了许多复杂的类型。

由于Redux是Rematch的依赖项,因此您可能需要删除`package.json`中对Redux的引用并重新安装模块。

PreviousTestingNextImmer

Last updated 6 years ago