Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Oops! You need to be logged in to do that
Not Found
Not Found
Not Found
Not Found
Not Found
Oops! You need to be logged in to do that
Oops! You need to be logged in to do that
Not Found
Not Found

Submitted

Responsive Github Search Page

#react#sass/scss#bem
P
Clytax 90

@Clytax

Desktop design screenshot for the GitHub user search app coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
  • API
2junior
View Challenge

Design Comparison

SolutionDesign

Report

2

Accessibility Issues

0

HTML Issues

View Report

Clytax’s questions for the community

Questions:

  • How can I catch it if the api call doesn't find a user with that name?
  • Do you like the way I implemented responsive design?
  • I have been struggling with using global state, is Zustand a good package for this?

Community Feedback

@fazzaamiarso

Posted

Hello Clytax! Nice solution!

The easiest way to handle the error is by throwing an exception on the response and appending .catch on your promise chain. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch

.then(res => {
if(!res.ok) throw Error('Failed to fetch');  //exception;
return res.json();
}).then().then().catch(error => console.log(error.message) )

I also recommend you to read this article to answer your state question https://kentcdodds.com/blog/application-state-management-with-react

I hope it helps! Cheers!

0

Please focus on giving high-quality, helpful feedback and answering any questions Clytax might have. Here are some key points to consider:

  • Does the solution include semantic HTML?
  • Is it accessible, and what improvements could be made?
  • Does the layout look good on a range of screen sizes?
  • Is the code well-structured, readable, and reusable?

You can read our community guidelines if you're unsure what to post.

Slack logo

Join our Slack community

Join over 100,000 people taking the challenges, talking about their code, helping each other, and chatting about all things front-end!