<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()}
一瞬で解決する。早くググればよかった。