useTable Typing error is unkown
Getting full typing expect for
error
:
tableData
, isLoading
, isSuccess
and refetch
are correctly typed. error
is unkown.
How to get correct typing on error?10 Replies
united-yellow•3y ago
Hey @zomh,
When you change the ‘HttpError’, do you still have unknown type? Could you try it?
rising-crimsonOP•3y ago
hello @salihozdemir you mean like this ?
const useTableMethods = useTable<ExpenseLaborAPI>({ ....
Its still unkownunited-yellow•3y ago
I mean, whether it is ‘unknown’ when you give any type instead of HhtpError.
If you have still issue, the first business day will disscuss this issue with team.
It seems we don't use generic error type in return type. Would you like to fix it? @zomh
https://github.com/refinedev/refine/blob/next/packages/react-table/src/useTable/index.ts#L19
GitHub
refine/index.ts at next · refinedev/refine
Build your React-based CRUD applications, without constraints. - refine/index.ts at next · refinedev/refine
rising-crimsonOP•3y ago
@Omer Thanks for the feedback. I am afraid i just learned typescript like 2 month ago. This exceeds my knowledge to be honest. Sorry gonna be honest 🥲
Don't worries. Could you create an issue? 🚀
rising-crimsonOP•3y ago
yes will do
We'll fix it monday
Hey @zomh ,
We've released @pankod/refine-react-table@4.9.1 🎯 Can you confirm that the problem is fixed?
You can use CLI's update command for update 👊
https://refine.dev/docs/packages/documentation/cli/#update
CLI | refine
refine CLI is a command line application that allows you to interact with your refine project and perform some tasks. This includes creating a new resource, managing updates, swizzle components, and runs your project (build, start, dev).
rising-crimsonOP•2y ago
@Omer @salihozdemir confirmed fixed. thank you!