-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Create Forms That Have Input in Controlled State #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Create Forms That Have Input in Controlled State #11
Conversation
stephenmckeon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! Nice job.
| @@ -1,17 +1,39 @@ | |||
| import React from "react"; | |||
| import React, {useState} from "react"; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| import React, {useState} from "react"; | |
| import React, { useState } from "react"; |
| import { v4 as uuid } from "uuid"; | ||
|
|
||
| function ItemForm(props) { | ||
| function ItemForm({onItemFormSubmit}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| function ItemForm({onItemFormSubmit}) { | |
| function ItemForm({ onItemFormSubmit }) { |
|
|
||
| function handleFormSubmit(event) { | ||
| event.preventDefault() | ||
| const newItem ={ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| const newItem ={ | |
| const newItem = { |
Created Filter Component that have controlled state. Filter Component filters shopping list based on match in cart. Create Item Form that updates state to add new item to shopping cart
