Coder Social home page Coder Social logo

react-18-shopping-cart's Introduction

Simple Shopping Cart

Lessons

  1. create react app
    1. npx create-react-pp
    2. remove extra files
  2. create website layout
    1. add Header, Main and Basket component
    2. Style component
  3. create Main component
    1. create data.js
    2. render product items
  4. create Product component
    1. create product divs
    2. pass props to product component
  5. Implement cart
    1. add and remove items from the cart
  6. create basket component
    1. list items in cartItems
    2. calculate sub total
    3. show checkout button
  7. save cart items in local storage
    1. save items in local storage on add and remove
    2. use useEffect to get items in local storage
  8. use useTransition and useDeferedValue
    1. read items in local storage using useTransition
    2. change cartItems.length to transition effect
  9. Deploy website on github pages
    1. login github account
    2. push code to github
    3. npm install gh-pages --save-dev
    4. package.json "homepage": "https://github_name.github.io/webapp_name",
    5. add deployment script: "predeploy": "npm run build", "deploy": gh-pages -d build",
    6. npm run deploy

react-18-shopping-cart's People

Contributors

basir avatar

Stargazers

 avatar  avatar Abhishek Mishra avatar Salah Uddin avatar mehdi behvar avatar

Watchers

 avatar  avatar

Forkers

sobuz80

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.