-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScript issue with flexrender for svelte-table examples #4778
Comments
Seeing the same issue, but even pinning to |
If your
so in order to fix your types, you can use your
instead of
|
Still not resolved. How can something like this happen? Don't you guys even test if your own basic example is still fine after changing stuff? |
Your suggestions appears to fix the typing issue but it outputs raw code instead of the component and so is not just a replacement solution. Perhaps I am doing something wrong. |
To whom it may concern, here is my temporary solution: import type { ComponentType, SvelteComponentTyped } from "svelte";
import { flexRender as flexRenderOrig } from "@tanstack/svelte-table";
const flexRender = <P extends Record<string, any>, C = any>(
component: C,
props: P
): ComponentType<SvelteComponentTyped> =>
flexRenderOrig(component, props) as ComponentType<SvelteComponentTyped>; Usage: <svelte:component
this={flexRender(
header.column.columnDef.footer,
header.getContext()
)}
/> |
@itssumitrai Besides the typing issue, would you happen to know if one approach is better than the other (in terms of performance, behavior, etc.)? Or are they mostly identical? |
@benbender Thanks, the solution worked for now. Hope this gets fixed. |
We will accept a PR for a fix |
I believe this ticket needs to be reopened. The commit and pull request mentioned is not actually merged into main |
Sir @tannerlinsley , please look into this. :). |
I'm pretty sure this has worked in the meantime but getting the same error now again, as well |
@KevinVandy Do you have any knowledge of what happened here? |
Looks like there was a problem last month where a push erased some git history. The last few prs merged are missing in the main branch |
Re-released in 8.9.6 |
Describe the bug
On the newest version of TypeScript (5.0.2) and Svelte (3.57.0), running the examples, for instance the "Sorting" example for svelte-table, there is a TypeScript error that I am unable to wrap my head around. It occurs for every flexRender inside a dynamic Svelte component (svelte:component).
Inside the dynamic SvelteKit component, the following TypeScript error occurs, for instance the main table body:
It seems like the flexRender doesn't have all the typing information that Svelte wants.
Note: everything still works as required, the table renders without errors. This seems to be a TypeScript-only issue.
Any help or primers on how to begin solving this would be appreciated.
Your minimal, reproducible example
https://codesandbox.io/p/sandbox/happy-leaf-eyudi0?file=%2Fsrc%2FApp.svelte
Steps to reproduce
Expected behavior
No error is shown, as the underlying code seems to work (the table renders).
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
react-table version
8.8.4
TypeScript version
5.0.2
Additional context
No response
Terms & Code of Conduct
The text was updated successfully, but these errors were encountered: