Explore all blogs
'react-scripts' is not recognized as an internal or external command
To solve the error: 'react-scripts' is not recognized as an internal or external command”, make sure the react-scripts npm package was installed in the project.
'Switch' is not exported from 'react-router-dom'
The React error 'Switch' is not exported from 'react-router-dom' occurs when we import 'Switch' from react-router-dom v6. In v6, ‘Switch’ was replaced by ‘Routes’
419 page expired error in Laravel
419 page expired error in Laravel occurs when the valid CSRF token is missing in the post request. Laravel checks the CSRF token in VerifyCsrfToken middleware.
Adjacent JSX elements must be wrapped in an enclosing tag
The "Adjacent JSX elements must be wrapped in an enclosing tag" error can be solved by wrapping the multiple elements in a parent div or in a react fragment
Block Scope and Shadowing in JavaScript
Learn what is a block, block scope, block-scoped variables, variable shadowing, and illegal shadowing in javascript with examples.
Build password strength checker in React
Learn how to build password strength checker/indicator/meter in React to check uppercase, lowercase letters, numbers, special characters, and password length.
Call multiple functions onClick in React
To call multiple functions onClick in React, pass an event handler function into the onClick prop of the element that can call as many other functions as necessary.
Can't Perform a React State Update on an Unmounted Component
Check why the warning “Can't perform a react state update on an unmounted component” occurred and how to solve it using a flag in useEffect hook.
Can't set headers after they are sent to the client
Error “Can't set headers after they are sent to the client” occurs when an express.js application tries to send multiple responses for a single request.
Cannot read property of undefined in JavaScript
The TypeError: Cannot read property of undefined occurs when we try to read a property on an undefined variable or when we try to access a property on a DOM element that doesn't exist.
Create a Back button with React Router
To create a back button with React Router use useNavigate() hook. Call navigate function eg. navigate(-1); inside the onClick function of the back button.