Skip to content
Source
Sign inSign up
TanStack/store

Type error in `useStore` when upgrading from 1.28.0 to 1.28.4 #323

Opensondr3(GitHub profile, opens in a new tab) opened this issue 2 comments

Describe the bug

We have a fair few places in our codebase where we have previously done

  const formState = useStore(form.store);

which has worked fine until I just tried to upgrade to 1.28.4, where it now fails with

src/App.tsx:13:21 - error TS2554: Expected 2-3 arguments, but got 1.

13   const formState = useStore(form.store)

And yes, I know this is not how you're supposed to write it, but that's how it was written by the guy who wrote it.

Your minimal, reproducible example

https://github.com/sondr3/tanstack-react-form-types

Steps to reproduce

  1. pnpm build
  2. Observe type error

Expected behavior

No breaking changes in patch releases.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

N/A

TanStack Form adapter

react-form

TanStack Form version

1.28.4

TypeScript version

5.9.3

Additional context

No response

  1. Transferring this issue to TanStack Store, since we need to fix it here before updating TanStack Form with it. I'll try to take care of that soon.

  2. TanStack Store was updated in TanStack Form. From 0.9.1 to 0.11.0 in this commit: https://github.com/TanStack/form/commit/808f158b62c08f69689a7b652c35989d717f9014#diff-32824c984905bb02bc7ffcef96a77addd1f1602cff71a11fbbfdd7f53ee026bb

    Released as "@tanstack/react-form": "1.33.0", however useStore seems deprecated now, and useSelector is not exposed with TanStack Form, so for now, I'm stuck to use TanStack Form v1.32.0 until this issue is resolved.

Sign in to join this conversation.