These are install instructions for the latest version of Material React Table (V3)
CompatibilityFirst, before installing Material React Table, let's make sure you have the correct versions of React, Material UI, and Material UI X Date Pickers installed.
MRT
React
Material UI
MUI Icons
MUI X Date Pickers
Emotion
Pigment CSS
4.x (Next Version) 18.0+ 6.0+ 6.0+ 7.15.0+ Optional Optional 3.x (This Version) 18.0+ 6.0+ 6.0+ 7.15.0+ 11.0+ Optional 2.x 17.0+ 5.13+ 5.0+ 6.15+ 11.0+ - 1.x 17.0+ 5.0+ 5.0+ Optional 11.0+ -Quick Install
material-react-table
requires Material UI V6 packages as dependencies in your project.If you are already using Material UI, you probably already have most of these peer dependencies installed.
Just double-check that you have the following in your package.json, or use the full install commands below.
@mui/material
(V6)
@mui/x-date-pickers
(v6)
@mui/icons-material
(V6)
@emotion/react
(v11)
@emotion/styled
(v11)
react
andreact-dom
(v18+)
Install With Required Peer Dependencies (Recommended)$ npm i material-react-table
$ npm i material-react-table @mui/material @mui/x-date-pickers @mui/icons-material @emotion/react @emotion/styled
Common ErrorsYou do NOT need to install
@tanstack/react-table
, as it is already an internal dependency ofmaterial-react-table
, and must use an exact version already specified internally.All internal dependencies:
@tanstack/match-sorter-utils
,@tanstack/react-table
,@tanstack/react-virtual
, andhighlight-words
If you see a react import error like this:
$ Uncaught TypeError: (0 , import_react15.useId) is not a function
at useMRT_TableOptions (useMRT_TableOptions.ts:95:8)
at useMaterialReactTable (useMaterialReactTable.ts:12:24)
It means that you don't have the correct version of React installed. Make sure you have React 18.0 or higher.
If you get an error like this:
$ "Error: Element type is invalid: expected a string (for built-in components)
or a class/function (for composite components) but got: undefined.
You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
Or You might be trying to import MaterialReactTable
from the default export still, which is no longer supported in v2+. Make sure you are importing the named export instead:
- import MaterialReactTable from 'material-react-table'
+ import { MaterialReactTable } from 'material-react-table'
Or you probably do not have the correct version of Material UI installed. Make sure all material ui packages are at least V6.0 or higher if you are using MRT v3 or higher.
If you are using an older version of webpack
or create-react-app
and get an error like this:
$ ./node_modules/@tanstack/virtual-core/build/lib/index.esm.js 147:92
Module parse failed: Unexpected token (147:92)
File was processed with these loaders:
Then try upgrading either webpack
or react-scripts
to the latest versions.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4