Mortgage Calculator using react-hook-form and TypeScript.
Design comparison
Solution retrospective
I'm mostly proud of the fact that I got to learn how to use the react-hook-form and also completing this project while using TypeScript for the first time with Next.js.
What challenges did you encounter, and how did you overcome them?I explained all these details in my README.md file
What specific areas of your project would you like help with?Mainly accessibility and better coding practices when using Next.js/React.
Community feedback
- @qadzekPosted 3 months ago
Well done, impressive work!
TypeScript can be annoying indeed but it catches so many bugs. If you have trouble finding the TypeScript types, hovering over them in VS Code in the right place should reveal them.
Congrats on implementing the comma separator, I skipped over that part.
Possible improvements:
- The interest rate input field should accept all floats, e.g.
4.9
. - Don't use HTML like
<br />
in Markdown. - Try using template literals (backticks) instead of
spanValidClass
andspanInvalidClass
, to avoid duplication. Intl.NumberFormat
might be helpful.- Clicking on the far end of the box containing the radio button should work.
Marked as helpful0@tesla-ambassadorPosted 3 months ago@qadzek Thank you for your feedback! It's very much appreciated. I'm already working on another challenge and I'll be sure to apply what you've mentioned. I tried Intl.NumberFormat but I wanted to play around with regex. I do hover over functions and variables in VS Code... It's how I've been learning a lot more about TypeScript, it's very helpful. Thanks for taking the time to look at my code and helping me out... I'll be sure to implement this advice in my next challenge. Happy coding!
0@tesla-ambassadorPosted 3 months ago@qadzek I tried adding 4.9 on the interest rate input field and it worked on my end... Does it show an error message on yours?
0@qadzekPosted 3 months ago@tesla-ambassador
I also learned that event handlers are of type React.ChangeEvent<HTMLInputElement>
To find out this type, inline the callback function (e.g.
<input onChange={ ev => ... }>
) and hover overev
.I tried adding 4.9 on the interest rate input field and it worked on my end... Does it show an error message on yours?
Not sure what is going on. Sometimes it works without issues, sometimes I get
Please select a valid value. The two nearest valid values are ...
.1 - The interest rate input field should accept all floats, e.g.
- @ApplePieGiraffePosted 2 months ago
Broooooo
I've just seen this!!
Nice work dude! 😎 Your solution looks great and I loved reading your README 😂 You put a lot of thought into this and that's how you learn the most!
Keep on grinding my guy and happy coding!! 😁
EDIT: I'm touching grass these days... whenever I can 😜
1@tesla-ambassadorPosted about 2 months ago@ApplePieGiraffe Thank you bruvvv! I'm working on something bigger with the interactive comment section. I'll be sure to let you know when it's done 😉
PS: Touching grass is important for a jedi to become one with the code!
1
Please log in to post a comment
Log in with GitHubJoin 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