Fix – cannot read property setState of undefined
If you get cannot read property setState of undefined when writing a code in React, this article will fix your problem. The issue occurs because the this keyword is not pointing out the right scope of the component. You can fix this by binding your function: Or in the latest (and simple) version, you can […]