Physical Address

304 North Cardinal St.
Dorchester Center, MA 02124

Category ReactJS

‘Switch’ is not exported from ‘react-router-dom’

Switch' is not exported from 'react-router-dom'

The error ‘Switch’ is not exported from ‘react-router-dom’ occurs when we try to import the Switch component  react-router-dom but it is not found. Here is how we can fix it: In react-router-dom version 6, Switch has been replaced by Routes. Therefore, we need to update the import statement…

React Props Validation with Example

React Props Validation with Example

React Props are an important mechanism in our application, since they are read-only and immutable, the React props validation becomes a big issue because props are used to transfer data from one component to another component. If the component gets…

React useImperativeHandle Hook

React useImperativeHandle Hook

In this part, we will learn about react useImperativeHandle hook. In react, Data can be passed from parent to child component using props, which is known as unidirectional data passing. In the case of props, the parent component cannot access…