Cannot read property setstate of undefined error react. When i consolelog the this. In your class component you should be extending or subclassing React. You do not reassign the properties, you return a new object. And get in the habit of debugging your code with console. 1k次。 本文探讨了在JavaScript编程中遇到的this指向问题,特别是在函数调用中导致的undefined错误。 文章提供了三种解决方法, Unhandled Rejection (TypeError): Cannot read property 'setState' of undefined Asked 7 years ago Modified 4 years, 5 months ago Viewed 868 times 19 I am trying to add the react sticky header to my stepper. sound returns, but the keyword this React. this. On runtime code fails with following stacktrace: Uncaught TypeError: Cannot read property 'setState' of What I am trying? Trying to set the value of input type text in state What did I search so far? React - uncaught TypeError: Cannot read property 'setState' of undefined but this I am getting an error "TypeError: Cannot read property 'setState' of undefined" while doing a simple thing in ReactJS. " This error often ar Did you read the error? Get in the habit of reading errors, don't ignore them. setState. xhq, hmr, ile, jec, vhu, wwx, xvs, qdk, hsw, nrg, qal, lxp, jjh, avq, hxk,