Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 3 years ago

Responsive E-commerce Page with NextJS/React, TypeScript & Tailwind

next, react, tailwind-css, typescript
Francisldn•250
@francisldn
A solution to the E-commerce product page challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Challenges that I faced while building the project

Create Lightbox feature

  • This is my first attempt at coding a lightbox feature. I have referred to a youtube tutorial which provides ideas about different ways of closing a lightbox (ie. 'escape' key, clicking outside the lightbox). Through the process, I learnt how to use useCallback hook in combination with useEffect

Typescript errors

  • Also learnt about how to resolve typescript errors relating to useRef hook. Another instance of typescript error is different ways of typing event. In particular, I realised that I need to denote React.MouseEvent for onClick event type, and not just MouseEvent

Reusable React components and refactoring

  • Through the process, I gained a deeper understanding of ways to create re-usable components in React and how to refactor the code to keep it DRY.

Any comments / feedback would be much appreciated.

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 Francisldn'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