gregnb / mui-datatables

Datatables for React using Material-UI
MIT License
2.7k stars 931 forks source link

TypeError: styles.makeStyles is not a function #1753

Open eminbayrak opened 3 years ago

eminbayrak commented 3 years ago

I am using Material-UI v5.0 beta and mui-datatables is not completable yet with this version. Getting the following error. Could you please update the packages to make it compatible? Thank you so much!

TypeError: styles.makeStyles is not a function
./node_modules/mui-datatables/dist/index.js
src/components/TableBodyCell.js:6
  3 | import TableCell from '@material-ui/core/TableCell';
  4 | import { makeStyles } from '@material-ui/core/styles';
  5 | 
> 6 | const useStyles = makeStyles(
  7 |   theme => ({
  8 |     root: {},
  9 |     cellHide: {
Tech Version
Material-UI "@material-ui/core": "^5.0.0-beta.1
"@material-ui/icons" ^4.11.2
@material-ui/lab ^5.0.0-alpha.40
@material-ui/styles ^5.0.0-beta.1
@material-ui/utils ^5.0.0-beta.0
MUI-datatables ^3.7.7
React ^17.0.2
gustavoborbae commented 2 years ago

Same issue here.

kaveiros commented 2 years ago

Facing the same issue as well. Any updates on this?

nandorcsupor commented 2 years ago

Same issue here. Any updates ?

import { Button, makeStyles } from '@mui/material'

const useStyles = makeStyles((theme: { spacing: (arg0: number) => any; }) => ({ container: { padding: theme.spacing(4), display: "flex", justifyContent: "flex-end", gap: theme.spacing(1) }, }))

const classes = useStyles()

Error: const useStyles: never This expression is not callable. Type 'never' has no call signatures.ts(2349)

ghost commented 1 year ago

Same issue

NatanR-dev commented 1 year ago

Guys, makeStyle is deprecated in v5, try to use: styled() or that solution tss-react