Async accessorFn
I ran into a situation where I felt like I needed an async accessorFn. It seems like this isn't supported. Has anyone else run into this type of thing?
5 Replies
conscious-sapphire•2y ago
i'm trying something similar where i want to call a server action for a cell but this does not seem to support async. this is what i'm trying:
but i get the following error:
Cannot destructure property 'row' of 'undefined' as it is undefined.
foreign-sapphire•2y ago
Any chance you could return an unawaited promise from the cell fn, then await it in your component?
Without knowing the specific use case, it's hard to say that this is a good idea though 😬.
conscious-sapphire•2y ago
not really. i'm trying to make my Columns: ColumnDef function to be a server component so it can't have callouts to functions.
foreign-sapphire•2y ago
Won't this mean there's a network/io request of some kind for each of these cells?
conscious-sapphire•2y ago
nah, i'm just wanting to pass the row