Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 9 months ago

Multi Step form with TypeScript and more...

react, react-router, tailwind-css, vite, typescript
Daniel Michael Villanueva•290
@DanVillanueva30
A solution to the Multi-step form challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

At first, I thought it would be easy to complete, but when I started coding I realized the importance of the little details. To validate the fields of the personal information form I used react-hook-form, this is a tool that I've recently started to use and I thought it was a great opportunity to implement it, However I later realized it might not be the best option because this is the only form and component where I can use it. Although it makes input validation easier I will start working on a solution without this tool.

What challenges did you encounter, and how did you overcome them?

The most challenging part was setting up the context for the global state, especially the function that updates the selection of add-ons. Initially, it was poorly written because it only accepted a value with a defined type and did not consider that it could also be updated with information from the previous state. It took hours of research, trial, and error, but in the end, I managed to find a solution.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Javier de Santiago•110
    @javierdesant
    Posted 9 months ago

    Hey @DanVillanueva30, ¡buen trabajo!

    Me gusta lo que has hecho, implementando react router y useContext. Eso sí, ten cuidado con tu barra lateral, si no validas los pasos antes de redirigir al usuario te pueden enviar un formulario vacío...

    Por lo demás está bastante bien, Sigue así 👍

    Marked as helpful

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
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit 1st-party linked stylesheets, and styles within <style> tags.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub