Skip to content

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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