1/5
Easy#patchtypescripttypesmiddlewaredevtools

Fix type inference for the devtools initializer

pmndrs/zustand#3511 · @dbritto-dev, @dai-shi · MIT · licence

a slice of a larger PR (2 files) · see it all

description
## Related Bug Reports or Discussions Related Discussion: #3510 Regression PR: #2875 ## Summary - Improves type inference for the devtools initializer in the Devtools middleware type. - Adds a dedicated type-level regression test for the #3510 scenario in tests/middlewareTypes.test.tsx to ensure create<MyState>()(devtools((set, get) => ...)) keeps set/get correctly inferred.
7 commits · 1 file
  • 89ca618fix(devtools): improve type inference for Devtools initializer
  • b3e7b4ffix(devtools): enhance type inference for Devtools initializer
  • c75c5f0test(types): add devtools inference regression for #3510
  • ec094e9Rename options parameter to devtoolsOptions
  • 8590875test(types): fix lint in devtools #3510 regression case
  • d3cdcfetest(types): simplify lint-safe ts-expect-error expression
  • 488862fMerge branch 'main' into hotfix-devtools-type-inference

▸ tap the line(s) in the diff

Msrc/middleware/devtools.ts+1−1
@@ -96,7 +96,7 @@ type Devtools = <