Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 1 year ago

Body Mass Index Calculator

react, redux
Abel Muro•1,920
@AbelMuro
A solution to the Body Mass Index 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?

I am most proud of using Framer-motion to implement a bit of animation in the app. I feel like that using animation libraries can add a cherry on top of the website or application and can give a better user experience.

What I would do differently next time is use GSAP to add more scrolling animation. It's been a while since I worked on that particular library

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

The biggest challenge was implementing the logic necessary to calculate the body mass index of the user based on their weight and height. I have to be honest here, I used AI to retrieve the formulas necessary to do just that.

With the formulas, I used the global store from Redux to retrieve the users input to calculate the BMI in another component.

What specific areas of your project would you like help with?

With these types of apps, I always struggle with organizing the code and logic in the app that makes it more readable and scalable.

But the premise is simple with this one, I used to get the users weight and height, and for every blur event that is triggered from the , I dispatch an action to the global store.

The Results component will access the global store and retrieve the weight and height of the user and perform the calculation necessary to display the users BMI.

I feel like this logic is organized, but if you think there's a better way of implementing such logic, then please tell me.

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Abel Muro'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

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

Frontend Mentor

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

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