material-tailwind icon indicating copy to clipboard operation
material-tailwind copied to clipboard

look

Open NuriaAgbasi opened this issue 1 year ago • 11 comments

Cannot read properties of null (reading 'useContext') TypeError: Cannot read properties of null (reading 'useContext') at useContext (http://localhost:3002/static/js/bundle.js:21236:25) at useTheme (http://localhost:3002/static/js/bundle.js:19732:32) at http://localhost:3002/static/js/bundle.js:19546:40 at renderWithHooks (http://localhost:3002/static/js/bundle.js:75858:22) at updateForwardRef (http://localhost:3002/static/js/bundle.js:79107:24) at beginWork (http://localhost:3002/static/js/bundle.js:81168:20) at HTMLUnknownElement.callCallback (http://localhost:3002/static/js/bundle.js:66114:18) at Object.invokeGuardedCallbackDev (http://localhost:3002/static/js/bundle.js:66158:20) at invokeGuardedCallback (http://localhost:3002/static/js/bundle.js:66215:35) at beginWork$1 (http://localhost:3002/static/js/bundle.js:86113:11)

NuriaAgbasi avatar May 05 '24 20:05 NuriaAgbasi

same here, i think there is a bug or something with the component

handhikadsa avatar May 06 '24 06:05 handhikadsa

I got the same error, after I upgraded "react" and "react-dom" to version 18.3.1. I had to downgrade those two packages to version 18.2.0 to be able to keep using "@material-tailwind/react".

eggert-plaio avatar May 06 '24 10:05 eggert-plaio

I got the same error, after I upgraded "react" and "react-dom" to version 18.3.1. I had to downgrade those two packages to version 18.2.0 to be able to keep using "@material-tailwind/react".

worked perfectly, thanks !

imaiomar avatar May 06 '24 22:05 imaiomar

I got the same error, after I upgraded "react" and "react-dom" to version 18.3.1. I had to downgrade those two packages to version 18.2.0 to be able to keep using "@material-tailwind/react".

It worked thanks 😊

NuriaAgbasi avatar May 06 '24 22:05 NuriaAgbasi

is there no solution from material-tailwind team?

mike-katz avatar May 14 '24 13:05 mike-katz

I got the same error, after I upgraded "react" and "react-dom" to version 18.3.1. I had to downgrade those two packages to version 18.2.0 to be able to keep using "@material-tailwind/react".

Not working

@eggert-plaio this is my package.json

{
  "name": "myapp",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@material-tailwind/react": "^2.0.4",
    "@testing-library/jest-dom": "^5.17.0",
    "@testing-library/react": "^13.4.0",
    "@testing-library/user-event": "^13.5.0",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-scripts": "5.0.1",
    "web-vitals": "^2.1.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "tailwindcss": "^3.3.2"
  }
}

mike-katz avatar May 14 '24 13:05 mike-katz

I got the same error, after I upgraded "react" and "react-dom" to version 18.3.1. I had to downgrade those two packages to version 18.2.0 to be able to keep using "@material-tailwind/react".

Not working

@eggert-plaio this is my package.json

{
  "name": "myapp",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@material-tailwind/react": "^2.0.4",
    "@testing-library/jest-dom": "^5.17.0",
    "@testing-library/react": "^13.4.0",
    "@testing-library/user-event": "^13.5.0",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-scripts": "5.0.1",
    "web-vitals": "^2.1.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "tailwindcss": "^3.3.2"
  }
}

dont use "^" instead do this: "react": "18.2.0", "react-dom": "18.2.0",

handhikadsa avatar May 15 '24 04:05 handhikadsa

@handhikadsa

Working fine Thanks.

mike-katz avatar May 15 '24 06:05 mike-katz

I got the same error, after I upgraded "react" and "react-dom" to version 18.3.1. I had to downgrade those two packages to version 18.2.0 to be able to keep using "@material-tailwind/react".

Working perfectly, Thanks 😊

Ravi-narola avatar Jun 30 '24 10:06 Ravi-narola

Had a similar issue, downgraded material-tailwind to 2.0.5. This seems to be the same issue as this thread: https://github.com/creativetimofficial/material-tailwind/issues/693#issuecomment-2208242993

kylegendy avatar Jul 11 '24 15:07 kylegendy