Uncaught TypeError Cannot read properties of undefined reading 'setState' reactjs onClick event bind

Publié le: 10 février 2022
sur la chaîne: Tech Nursery
4,610
22

In this video ,we fixed the error Uncaught TypeError Cannot read properties of undefined (reading 'setState') react-dom.development js 4091
onClick event Button React Native/React js at clickHandler (Button js:15:1)

We explained two options .you can use any of them
first option is to add a line into constructor function of class component in react js /react native

second option is to rewrite the event handler as arrow function .In this case we modified loginHandler as arrow function

Uncaught TypeError
Cannot read properties of undefined (reading 'setState')
react-dom.development
eventHandler
eventBinding
this keyword


Sur cette page du site, vous pouvez voir la vidéo en ligne Uncaught TypeError Cannot read properties of undefined reading 'setState' reactjs onClick event bind durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Tech Nursery 10 février 2022, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 4,610 fois et il a aimé 22 téléspectateurs. Bon visionnage!