Giter Club home page Giter Club logo

advanced-state-practice-2's Introduction

In CarListing component

  • Add a prop type for a prop called “car” which should be an object and required
  • replace the hard coded information with the data from the car object in props
  • year, make, model, price miles…. etc

In App.js find <div className="form-group select"> that has the “Select Year” drop down

  • Change the hard coded years to use the data from the allYears array
  • map the array to create an array of <option value=“2001”>2001</option>
  • register onChange for the select element. Make sure to use arrow function with e argument
  • on change setState currentYear to the value from the e.target

In App.js find <div className="form-group select"> that has the “Select Brand” drop down

  • Change the hard coded makes to use the data from the vehicleData array
  • map the array to create an array of <option value=“ACURA”>Acura</option>
  • the text should be the title, the value of the option should be the value property
  • register onChange for the select. Make sure to use arrow function with e argument
  • on change setState currentMake to e.target.value

In App component

  • In the render method, filter the carsForSale array on the currentYear and currentMake state properties
  • If currentYear and currentMake are null or blank then don't filter
  • Instead of one hard coded CarListing component, map the the filtered array into a CarListing array
  • Provide the CarListing component with a prop called “car” which should be the object from each map loop
  • Place the CarListing array where it should go in the html

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.