Skip to content
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

react2-week1/katayoun #294

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

react2-week1/katayoun #294

wants to merge 5 commits into from

Conversation

katayouny
Copy link

No description provided.

@github-actions github-actions bot changed the title Github user searching v.1 react2-week1/katayoun Apr 12, 2024
<input
type="text"
placeholder="insert user"
style={{
Copy link

Choose a reason for hiding this comment

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

Try to avoid using inline styles when possible. Instead, consider moving the styles to a CSS file.

Copy link
Author

Choose a reason for hiding this comment

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

Hey @aina21
Yes, thank you.

Copy link
Author

@katayouny katayouny Apr 17, 2024

Choose a reason for hiding this comment

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

@aina21
Could you please tell me why I can't see the search results? I get no error. I tried to see what I would get in fetch using console.log(data), and then I could see the items. Therefore I used data. items. However, I would get no search results in the browser. Could you please help me where the problem is? Thank you so much.

function UserSearchResult() {
const { query, loading, error, searchResult } = useContext(userContext);

return (
Copy link

Choose a reason for hiding this comment

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

Consider simplifying the conditional logic. You could use a helper function or separate the outputs using if conditions, like so:

if (loading) return <div className="loading">Loading...</div>;

…ion.jsx + installing and using useDebounce + making key correction <li key={result.id}>{result.login}</li>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants