Giter Club home page Giter Club logo

react-workshop's Introduction

  1. Open a terminal tab, and run npm install to download the dependenices.
  2. In that same tab (after completion), run npm start to start your node server.
  3. In a NEW terminal tab, run npm run build to start Webpack, which will watch and auto-transpile your files (using Babel). Make sure this tab remains running.
  4. Open up a chrome tab at localhost:3001 to see your code being rendered.

Overview of this repo

  • With this project, we will be creating an application that will display a list of cocktails made with a searched ingredient.

  • Our task is to build out functionalities to render a default list of cocktails, add cocktails to a favorites list, and remove cocktails from our favorites. Let's get started!

Checklist of Features to Complete

Step 1: Connect your React app to the browser, using index.js

  • Render App.jsx to our index.html.

Step 2: Start writing out App.jsx component

  • Create App, as a stateful/class component.
  • Create a piece of state to store an array of drinks, which will be used to render a list of cocktails.
  • Render the List component inside of the App component.

Step 3: Write out List.jsx and ListItem.jsx

  • Create both List and ListItem as functional components.
  • Connect the two components (in React style), using the comments at the top of each file as a guideline.

Leave this hard-coded for now; we will refactor momentarily.


Step 4: Check your work

  • Make sure you are able to see the hard-coded List and ListItems in your browser.

Step 5: Refactor List.jsx and ListItems.jsx for variable data

  • Import the static drink data from dummy.js and have App.jsx set its state once the page is loaded
  • List should render one ListItem for each drink in the array in App's state
  • ListItem components should be able to conditionally render the drink's strDrink (name), and strDrinkThumb (thumbnail image) based on what is passed down to it via props.

Step 6: Check your work

  • Set App's state to a real list of cocktails, by importing and using dummy.js
  • You should see a rendered list of cocktails, with their name and image displayed.

Stretch Goal 1: Write out Favorites.jsx

  • Create Favorites as a functional component
  • Update app's state to store a list of favorite drinks

Stretch Goal 2: Add favorite functionality to App.jsx

  • When a ListItem is clicked, it should be added to the favorites list and rendered on the page.

Stretch Goal 3: Add functionality to remove favorites to App.jsx

  • When a favorite is clicked, it should be removed from the favorites list in state and the page should rerender accordingly.

Further steps to test your abilities are to come!

react-workshop's People

Contributors

uncosung avatar

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.