Directly passing functions to custom cells #3189
Unanswered
salmanbabri
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In the editable cell sandbox, the
updateMyData
function gets passed to the editable cell viauseTable
hook.The code looks something like this:-
Then in the
useTable
hook,updateMyData
function is passed to it :-const { getTableProps } = useTable( { columns, data, defaultColumn, updateMyData } )
While this works perfectly, it does feel a bit like magic & my IDE complains about it too.
Is there a more direct way of doing it? Perhaps turning
defaultColumn
into a function that takes the updater function as input & returns EditibleCell with the updater function hooked with it.I am a bit confused about how to achieve that exactly, some code suggestions would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions