草庐IT

receiptnumber

全部标签

javascript - 类型错误 : Cannot read property 'receiptnumber' of undefined in react native

我的组件有这些属性constructor(props){super(props);this._onPress=this._onPress.bind(this);this.state={receiptnumber:"",text:"",time:"",isDateTimePickerVisible:false};}我已经在执行良好的按钮的点击事件上绑定(bind)了_onPress方法。我正在_onPress方法中调用另一个方法_saveScheduleMessage,我试图访问this.state.receiptnumber我收到错误。_onPress(){try{if(Platfor