TypeError: Cannot read property ‘location’ of undefined – React JS Error Fix

This is one of the common errors caused while doing React routing. This happens when the browser tries to access the history object. You can fix this by adding a history object to routing. The full error is given below. TypeError: Cannot read property ‘location’ of undefined Error Fix You can fix this by using … Read more

How to use Material Icons with React

Here, I will show you how to use material icons in your react app. First of all, you need to install two packages. npm install @material-ui/core npm install @material-ui/icons Now it’s the time for you to select an icon from here. I have given below an example of using AccessAlarmIcon from the list. You can … Read more

How to get Data from Material UI TextField in React

Material UI is one of the most popular UI framework for reactJS. It reduces your work and you can easily implement components. Material UI TextField is convenient for forms and this blogpost will teach you how to get data from it. As you know, Material UI TextField is a controlled component. onChange prop is used … Read more

How to Add OnClick Function to Material-UI Button in React

As you know, material-ui is one of the most popular react component library which implements Google’s material design. When you are looking the props for Button in material-ui you may notice that onClick is missing. Yes, you are right, material-ui has not documented common react events. You can add onClick function to material-ui Button as … Read more

‘react-scripts’ is not recognized as an internal or external command ReactJS Error Fix

While developing react apps it’s common to face ‘react-scripts’ is not recognized as an internal or external command react error. The full error is as given below: ‘react-scripts’ is not recognized as an internal or external command, operable program or batch file. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! login-app@0.1.0 start: react-scripts … Read more