Skip to content

Trouble with useTable data input (error recreated in CodeSandbox) #2278

Answered by egertaia
elaverack asked this question in General
Discussion options

You must be logged in to vote

Hey @WheatiesTM

I've fixed your error here - you still need a function for the Table so you can actually render it.
https://codesandbox.io/s/zen-goldstine-45966?file=/src/App.js

I've also added useCallback to your method, so it won't trigger re-render. It is not needed currently as it is static array you are going to return, but I imagine you are going to need to get this data from API or redux state, thus useCallback is more than welcome.

Let me know if you have any questions - I'll try to help you out.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by elaverack
Comment options

You must be logged in to vote
1 reply
@egertaia
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants