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

This project taught me invaluable lessons on planning before coding

tOnski86•330
@tOnski86
A solution to the Mortgage repayment calculator 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?

So this took me 2 (yes, that long) days. A lot of challenges came up on this one, but I am proud to have stuck through it and got it to the finish line.

Forced myself to keep using React x Tailwind. I'm starting to get the hang of Tailwind CSS for responsive designs and translating my vanilla CSS knowledge with ease (although I hit an epic fail on the React part).

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

This part is definitely going to be very long so I hope I won't hit the max char count :)

I'm splitting my challenges into these 2 categories:

Design

  • I've always found designing forms too painful. I figured that since I am already using Tailwind I'd give tailwindcss-forms a go. Boy was that a mistake. I could not target what I intended to style so I just reverted back to styling the generic HTML form elements.
  • Radio button styling. I tried the trick of creating my own custom radio but I could not get it to switch, so after a few hours I decided to use the default HTML radio buttons.
  • The input fields have an icon design. This is another painful part of the design process. I figured absolute positioning a span element would do the trick. Finally got it to work after another few hours.
  • I could not get the hover states exact as well. Also, when I wrapped up the logic of the app I could not get some transitions to work (such as fading in the results instead of immediately appearing).

Logic

  • Still using React for my core logic. I did take some time to structure my components, but realized later on that some of them had to be moved around due to needing access to state.
  • I was too overconfident with trying out useReducer and immediately figured out I was biting more than I could chew. I could not get access to any of my states from other components, since the reducer was residing in my form - way down the component tree. Another few hours of troubleshooting until I decided to simply use useState.
  • Since my forms are controlled elements in React, I basically created another issue with my validation. I could not leverage HTML form validation and had to come up with my own.
What specific areas of your project would you like help with?

Transitioning React components, and best practices for handling forms (state, validation and styling) in React.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on tOnski86's solution.

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 all CSS, SCSS and Less files in your repository.

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.

How does the JavaScript validation report work?

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

The report picks out common JavaScript issues such as not using semicolons and using var instead of let or const, among others.

The report will audit all JS and JSX files in your repository. We currently do not support Typescript or other frontend frameworks.