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?![No description](https://cdn.answeroverflow.com/1063810793260458055/image.png)
![No description](https://cdn.answeroverflow.com/1063810793474359396/image.png)
10 Replies
conscious-sapphire•2y ago
Hey @zomh,
When you change the ‘HttpError’, do you still have unknown type? Could you try it?
variable-lime•2y ago
hello @salihozdemir you mean like this ?
const useTableMethods = useTable<ExpenseLaborAPI>({ ....
Its still unkownconscious-sapphire•2y 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
variable-lime•2y 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? 🚀
variable-lime•2y 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).
variable-lime•2y ago
@Omer @salihozdemir confirmed fixed. thank you!