Issue with importing useTable from @tanstack/react-table

53 Views Asked by At

I'm trying to use the useTable hook from @tanstack/react-table in my React project, but I'm encountering an error saying "The requested module '/node_modules/.vite/deps/@tanstack_react-table.js' does not provide an export named 'useTable'". I've installed @tanstack/react-table version 8.13.2 and followed the documentation, but I can't seem to resolve this issue. Here's my import statement: import { useTable } from '@tanstack/react-table';

Double-checked the import statement to ensure it matches the documentation. Verified that @tanstack/react-table is correctly installed and its version matches what I have in my package.json. Looked through the documentation and GitHub issues for @tanstack/react-table to see if others have encountered a similar problem and found a solution.

I expected to be able to import the useTable hook from @tanstack/react-table without any errors, as per the documentation and examples provided. I expected to be able to use this hook to create tables in my React project as intended.

1

There are 1 best solutions below

0
On

Try using: import {useReactTable} from '@tanstack/react-table' instead