-
Notifications
You must be signed in to change notification settings - Fork 11
Adds ability to search for recipe & search for errors #4
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
Open
katiedavis
wants to merge
2
commits into
bridge-school:master
Choose a base branch
from
katiedavis:katie-davis
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from "react"; | ||
|
||
export const Recipe = ({ name, calories }) => { | ||
return ( | ||
<div key={name}> | ||
Name: {name} | ||
<br /> | ||
Calories: {calories} | ||
</div> | ||
); | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import React from "react"; | ||
|
||
export const Search = ({ onChange, value }) => { | ||
return <input value={value} onChange={e => onChange(e)} />; | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5126,7 +5126,7 @@ react-dev-utils@^5.0.0: | |
strip-ansi "3.0.1" | ||
text-table "0.2.0" | ||
|
||
[email protected]: | ||
react-dom@^16.2.0: | ||
version "16.2.0" | ||
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.2.0.tgz#69003178601c0ca19b709b33a83369fe6124c044" | ||
dependencies: | ||
|
@@ -5183,7 +5183,7 @@ [email protected]: | |
optionalDependencies: | ||
fsevents "^1.1.3" | ||
|
||
[email protected]: | ||
react@^16.2.0: | ||
version "16.2.0" | ||
resolved "https://registry.yarnpkg.com/react/-/react-16.2.0.tgz#a31bd2dab89bff65d42134fa187f24d054c273ba" | ||
dependencies: | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Be careful here. When binding an input like this, anyone can pass any function here. Like an API call 😉. What happens is that when a user types, they can keep typing, and each type will fire an independent API call. This means for
hello
we have 5 API requests and they all return at different times because APIs take their own time to return.One way to fix this problem is to use a function that keeps track, or holds on to the call for a certain amount of time, until either, the timer runs out, or the function is called again. This is traditionally called a
debounce
function. Its pretty normal to bind one to an input.