i new react-native. doing simple salary calculator component practice. have 2 textinput components, can't seem type in them. here code component:
class sueldocalc extends component { constructor(props) { super(props); } calcsalario() { console.log("calculating"); } render() { return ( <view> <text>entre las horas trabajadas:</text> <textinput /> <text>entre el rate por hora:</text> <textinput /> <touchablehighlight onpress={this.calcsalario}> <text>calcular salario...</text> </touchablehighlight> </view> ); } }
i tried subscribing ontextchange events, nothing. basic, can't find out there. please help! running app on android simulator visual studio.
you should specify ontextchange handler set state there. <textinput />
should have value property:
<textinput value={this.state.horas} onchange={this._onchangehandler} />
Comments
Post a Comment