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

Product preview card component with react

react
P
YK David KIM•100
@yk-david
A solution to the Product preview card component 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?

Building this preview card component in react was quite a challenge, but I could end up with mostly satisfied result. Next time, I would try to build it in vanilla html and css.

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

As the screen size gets larger or smaller, I need to choose accordingly the size of product photo (two different sizes). For this, I implemented some state logic to detect the viewport size and then choose the appropriate sized photo, but I didn't work.

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

I need help in product photo area with react state logic. Why doesn't product photo get replaced as screen gets larger?

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 YK David KIM'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