Skip to content

Latest commit

 

History

History
61 lines (32 loc) · 1.4 KB

README.md

File metadata and controls

61 lines (32 loc) · 1.4 KB

Burger-A

A web app that allows users to build their custom Burger & Mimic Checkout.

Installation

Install my-project with npm

  npm install my-project
  cd my-project

Demo

https://burger-a.netlify.app/make-burger

Support

For support, email [email protected] or send a message on Twitter.

Documentation

  • Created States for the individual ingridients(which was a bit stressful) e.g const [mayoCount, setMayoCount] = useState(2);

  • Created an object containing each ingridient and the current amount the user has added, which is by default = 0. E.g const burger = { mayo: 0, salad: 0, cutlet: 0, };

  • Now, for the best part, i'm using a very Intuitive(i must say) spread syntax technique i discovered to repeat a particular Ingredient based on the current count e.g {[...Array(burger.mayo + mayoCount)].map((index) => { return (img src=IMAGEURL />); })}

Helpful Links:

How to use ...Array(n) (https://simplernerd.com/jsx-repeat-n-times/)

Hooks

useState

useEffect

useContext

Acknowledgements

License

MIT