Home > other >  I am getting a blank page on my localhost 3000 on running npm start using reactjs
I am getting a blank page on my localhost 3000 on running npm start using reactjs

Time:12-27

I started making an a react app and added tag naming it with covid-19 tracker and on running npm start it perfectly showed the h1 heading i.e Covid 19 tracker but then I installed dependencies i.e

npm install @material-ui/core

and used some of its tags and then when I run npm start there was blank screen on my localhost:3000.

I added tags like and imported them from "@material-ui/core" so that a dropdown box will be added on running npm start but on ruuning npm start there was a blank screen ..nothing was shown..even the heading which was showing previously had gone .

I had pasted the image of App.js and localhost images below .

Code snippetlocalhosst screenshot after running dependency tags image without using dependency tags

CodePudding user response:

Material-UI/core is deprecated, it means that it is not compatible with current react version, therefore you can not use it on your project.

CodePudding user response:

As per Your first image you are calling react hook in class component or outside of functional component that is why that error is coming.

rules of hooks

And for Material-UI/core:

So Material-UI/core is now deprecated so you can't use it inside your project.

ref link

CodePudding user response:

import React from "react";

add this line at the beginning of the App.js file.

  • Related