Closed lrstanley closed 1 year ago
Hi! I'm having the same error, but if I mirror the component as you suggested it's solve the problem (thanks for the workaround).
Same issue here.
Type 'HeaderContext<TCity, unknown>' is not assignable to type 'string[]'
HTML is not being rendered within cell content; not sure if this is related.
got the same issue
I'm no longer using this package and cannot validate, however, it looks as though this was fixed in https://github.com/TanStack/table/releases/tag/v8.7.1. Will close this issue, but can easily be reopened if anyone is still having issues.
Describe the bug
@tanstack/vue-table
currently defines it'sFlexRender
component like so:However, it's expected with Vue 3 that if not using
<script setup />
(or similar), that the component is wrapped indefineComponent()
for proper type inference. Additionally, it looks as though without this, Volar (through VSCode), is acceptingstring[]
, rather thanany
:Looks like it might be picking the wrong
props
field from the defined component, as this is the generatedFlexRender
type from theindex.d.ts
file, and as you can see from the above screenshot, it thinks theprops
prop is actually theprops
field of the component that defines what props should be passed in:Your minimal, reproducible example
https://codesandbox.io/s/github/tanstack/table/tree/main/examples/vue/basic?from-embed=&file=/src/App.vue
Steps to reproduce
App.vue
and you should see that it is not expecting the appropriate type.Expected behavior
I would expect that it should pick up
any
, as the@tanstack/vue-table
defines theprops
property onFlexRender
without a type, and thus should beany
.How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
react-table version
v8.5.15
TypeScript version
v4.8.4
Additional context
If I mirror the
FlexRender
component into my application, and wrap it withdefineComponent
, it does seem to recognize that theprops
prop should actually beany
:I can submit a PR to resolve this, if this is a sufficient fix (to wrap with
defineComponent
).Terms & Code of Conduct