Giter Club home page Giter Club logo

boolean-uk-react-greengrocers's Introduction

React Greengrocers

You're going to recreate the javascript greengrocers exercise from scratch. But this time, using React!

Reusing an exercise that you already know will help you understand the fundamentals of React.

Setup

  1. Fork this repository
  2. Clone the forked repository onto your local machines
  3. In the root directory, type npm install, which installs dependencies for the project
  4. Finally, type npm run start, which starts a development server that runs your website in the browser. That server will reload your website whenever you make any changes to source files

Deliverables

  • A user can view a selection of items in the store
  • From the store, a user can add an item to their cart
  • From the cart, a user can view and adjust the number of items in their cart
    • If an item's quantity equals zero it is removed from the cart
  • A user can view the current total in their cart

Instructions

  • Create all the components you need, using the templates as a reference
  • Create all the pieces of the state you need, using the example provided
  • Add all the event listeners you need to make the page reactive

Tips

  • Create a diagram of your component hierarchy before starting to code
  • Annotate your diagram by adding what state each component needs to manage - React State or React Props

Extension 1

  • Add filters to the store ie. filter by item type; when a user clicks a filter they will only see items of that type
  • Add sorting to the store ie. sort by price or sort alphabetically; when a user clicks sort they will see a sorted list of items

Extension 2

  • Add a new detail component for each of the items, and render it conditionally after clicking on an item

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.