Age calculator for React, styled-components, Vitest practice

Solution retrospective
I probably overlooked a simpler approach, but I found calculating the age surprisingly tricky. I used it as an opportunity to familiarize myself with test-driven development (just for the logic part -- not so much on the rendered output). It was good fun, but I can't help feeling there's a better solution.
(PS I know I didn't implement the leap year edge case...hopefully there aren't any other holes in it though!)
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on Patrick Bryan'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