Undefined is not an object evaluating this.state.*

后端 未结 4 1055
不思量自难忘°
不思量自难忘° 2021-01-04 03:33

I\'m having an issue with posting data to an express REST API I have using fetch in my react-native app. Here\'s my code:

/**
 * Sample React Na         


        
4条回答
  •  长情又很酷
    2021-01-04 03:39

    React handlers are not automatically bound to the element/class they are in.

    
    

    https://facebook.github.io/react/docs/handling-events.html

    Excerpt from above link

    // This syntax ensures `this` is bound within handleClick
    return (
      
    );
    

提交回复
热议问题