reactinterface icon indicating copy to clipboard operation
reactinterface copied to clipboard

4. Adding Items - Issue with props vs refs

Open trivopr opened this issue 8 years ago • 0 comments

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.

trivopr avatar Dec 10 '16 18:12 trivopr