Skip to content

Nicole D'Augereaux#23

Open
nicolemichelle88 wants to merge 7 commits intoAustinCodingAcademy:masterfrom
nicolemichelle88:master
Open

Nicole D'Augereaux#23
nicolemichelle88 wants to merge 7 commits intoAustinCodingAcademy:masterfrom
nicolemichelle88:master

Conversation

@nicolemichelle88
Copy link

No description provided.

Copy link
Contributor

@canaandavis canaandavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall pretty good work.

You didn't really hit any of the extensions, and it still seems like you're struggling with passing things around as props and understanding that flow.

I would encourage you to continue working on this and getting the delete button working as well as other extensions.

You will be challenged with the checkpoint, but keep up the good work and you'll be great!

src/Contact.js Outdated
{props.occupation}
</div>
<button className="delete-button" onClick={
event => this.onClick(event)}>X</button>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're really close with this delete button!

Instead of passing in the event, we really want to pass the contacts _id. This means two things for you, first you need to be passing the _id as a prop. That is important so we can access it props._id.

Next you need to update your function to use the _id from props and not the event

onClick={()=> this.onClick(props._id)}

};
}

handleNameChange(event) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See if you can reduce all three of these handle functions into one like we included in the text book.

avatar={contact.avatar}
name={contact.name}
occupation={contact.occupation}
onClick={this._id}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is where you need to pass the contacts _id as a prop.

Also, in App.js you passed the function handleDeleteContact as the prop onClick, you need to pass that down one level again here.

You are saying the onClick prop is this._id, a couple of things wrong with that. this._id is undefined, and later inside your Contact component you are trying to call props.onClick() as a function, but its value is undefined so that will be an error.

Really what you want to do is pass the ContactLists onClick prop down to your contact

onClick={this.props.onClick}

something like that should do it for you.

@nicolemichelle88
Copy link
Author

nicolemichelle88 commented Feb 7, 2017 via email

@canaandavis
Copy link
Contributor

Great Job getting that delete button in there!!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants