Cocktail Info App (Frontend)

Avatar of 陳韋陵 (Wei-ling Chen).
Avatar of 陳韋陵 (Wei-ling Chen).

Cocktail Info App (Frontend)

Front-End Developer
Taipei City, Taiwan

Cocktail Info App

Frontend


Cocktail Info App (Frontend)

Links: Github LiveSite 

_________________________

Description

Welcome to my React practice project! This is a simple App made in React framework and Vite for development environment. It allows users to search the cocktails and see the details of the drink provided by TheCocktailDB.

_________________________

Front-End

  • React Router: using latest React Router syntax (v6)
  • Styled Components: using css in Js to style each components separately from the global css, avoiding name collisions
  • TheCocktailDB: free JSON API to grab the info from the cocktail database
  • TanStack Query: cache the searching result for better UX

_________________________

My Big Gotcha

  • React Router v6
  • Routes: action / loader
  • Component: Form
  • Hooks: useLoaderData / useRouteError / useActionData / useNavigation
  • Web api
  • FormData (return array of arrays)
  • URL constructor
  • TanStack Query (React Query)
  • grab react query in the loader: avoid refetching within stale time

_________________________

Reference

Last but not least... I would like to shout out to my online teacher John Smilga who designed the application, it's a really good practice to effectively learn routing and query packages.


React.js + CocktailDB api
Avatar of the user.
Please login to comment.

Published: Oct 2nd 2023
40
2
0

Tools

react
React

Share