Open bandinopla opened 1 day ago
I've done a type check on the useForceUpdate.mjs
module with the latest version of TypeScript and @types
packages installed, and can't see any errors. Can you please share what version of each of these you have installed:
@types/react
react
typescript
Also, can you please check if something in your project TS config is different to here, and share what changes to it reproduce the error?
Note that the hook returns the type React.DispatchWithoutAction
, which is a legit thing to do and that type comes from @types/react
:
The jsdoc says this function returns: https://github.com/jaydenseric/graphql-react/blob/38a7abcebf7e6d0e4e821c5c3982e8c1cbfae67e/useForceUpdate.mjs#L7
but then here: https://github.com/jaydenseric/graphql-react/blob/38a7abcebf7e6d0e4e821c5c3982e8c1cbfae67e/useForceUpdate.mjs#L12
It grabs the
dispatch
fromReact.useReducer
which expects an action... https://es.react.dev/reference/react/useReducer#dispatchThis makes typescript cry:
Target signature provides too few arguments. Expected 1 or more, but got 0.
I have set
skipLibCheck
to true but still get this error. I'm using vite... any ideas?https://github.com/jaydenseric/graphql-react/pull/63