LoginSignup
3
0

More than 1 year has passed since last update.

こんなんググるまでもないとか、勝手に決めつけるのはよくない。

Last updated at Posted at 2019-05-03
<Button title={"del"}/>

Warning: Failed prop type: The prop onPress is marked as required in Button, but its value is undefined.

はいはい、onPressがないのね。ググるまでもない。

<Button title={"del"} onPress={this.delText(index)}/>

Warning: Failed prop type: The prop onPress is marked as required in Button, but its value is undefined.

はいはい、onPressがないの??

いや、あるし。スペルミスか??

悩むこと15分。ようやくググる

React removed "autobinding" in ES6 component classes.

The code onPress={this.submithandler} could fail because it's not bound to anything.

Solution : Bind in render()

    onPress={this.submithandler.bind( this )} 

Another Solution : Fat Arrow Class Methods

        onPress={() => this.submithandler()} 

一瞬で解決する。早くググればよかった。

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0