Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Age Calculator using React

P

@KseniiaErnest

Desktop design screenshot for the Age calculator app coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


Hello Frontend Community! I believe that I've completed all the essential parts of the challenge. However, when incorrect input data is submitted, and an error or errors are triggered, the input data gets cleared. According to the challenge's instructions (error handling slides), incorrect data should remain present in the input fields. I think the solution should not be that difficult, but I cannot see it. Of course, I will check the solutions here and probably find it pretty quickly, but I would still appreciate feedback. :)

Community feedback

@OrkhanIsmayill

Posted

Hello, I looked at your code. First of all, I can say that you have structured the JavaScript code very logically ). I recommend that you use the .jsx extension at the end of your files. This way, you can catch React errors more effectively.Good luck :)

Marked as helpful

1

@viniciuspmacedo

Posted

Hello! In the "AgeInputForm" you can put a checking before you clean the inputs.

// Clear input values after successful submission
    if (setDayError === "" && setMonthError === "" && setYearError === "") {
      setDay("");
      setMonth("");
      setYear("");
    }

Marked as helpful

1

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord