How to implement a controlled sorting-state?
if I want control the sorting state of a
table v8 in react. Is this the approach to go? Thanks!
table v8function MyTable({ sorting, data, onSort }) {
const table = useReactTable({
data,
state: { sorting },
manualSorting: true ,
columns: tableColumns,
getCoreRowModel: getCoreRowModel(),
onSortingChange: (sorting) => {
if (onSort) {
onSort(sorting());
}
}
});
useEffect(() => {
setSorting(sortState);
}, [sortState]);
}You can now submit your website/app/project to http://TanStack.com 's new showcase and have it seen by the TanStack community! - Global showcase browser - Per-library filters - Category filters Submit here: https://tanstack.com/showcase/submit View all here: https://tanstack.com/showcase
dry-scarlet ยท 2w ago
TanStack AI Alpha 2 is here! ๐ผ๏ธ Image, video, audio, speech, transcription, structured output ๐ฆ Split adapters = smaller bundles, faster dev/contributions, easier ๐ Fully tree shakable adapters โจ Cleaner, flattened, fully type-safe APIs https://tanstack.com/blog/tanstack-ai-alpha-2
dry-scarlet ยท 4w ago
๐ฃ TanStack AI Alpha is here! โจ Framework agnostic ๐ค Provider agnostic ๐ง Type safe ๐ง Isomorphic tools ๐ Devtools ๐ Open protocol ๐ฆ JS, Python, PHP โ๏ธ React, Solid, Vanilla ๐ OpenAI, Anthropic, Gemini, Ollama, ++ Official blog post: https://tanstack.com/blog/tanstack-ai-alpha-your-ai-your-way Docs: https://tanstack.com/ai
dry-scarlet ยท 2mo ago