I have this code taken from a JavaScript post and I would like to use it in TypeScript but I get an error in function ContactProps({ columns, data })
The error is:
Binding element 'columns' implicitly has an 'any' type.
and
Binding element 'data ' implicitly has an 'any' type.
function ContactProps({ columns, data }) {
// Use the state and functions returned from useTable to build your UI
const { getTableProps, getTableBodyProps, headerGroups, rows, prepareRow } =
useTable({
columns,
data,
});
This one might solve your issue
function ContactProps({ columns:any, data:any }) {
const { getTableProps, getTableBodyProps, headerGroups, rows, prepareRow } =
useTable({
columns,
data,
});
or you can either remove the check for the "any" type in the declaration. In the tsconfig.json file, you could change the line
"noImplicitAny": false