reactinterface
reactinterface copied to clipboard
4. Adding Items - Issue with props vs refs
Hi Ray, I get a problem in Section 4. Adding Items. When i click: toggleAptDisplay and code below
toggleAptDisplay() {
this.props.handleToggle();
}
handleAdd(e) {
let objItem = {
petName: this.refs.inputPetName.value,
ownerName: this.refs.inputOwnerName.value,
aptDate: this.refs.inputAptDate.value + ' ' + this.refs.inputAptTime.value,
aptNotes: this.refs.inputAptNotes.value
} // objItem
e.preventDefault();
this.props.addApt(objItem);
} // handleAdd
Console log is : Uncaught TypeError: Cannot read property 'props' of null(…) The above problem on Refs is the same. Help me plz, Thanks.