Skip to content

4. Adding Items - Issue with props vs refs #2

@trivopr

Description

@trivopr

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions