Giter VIP home page Giter VIP logo

namethatpup's Introduction

Name That Pup! - HRLA React Review

Created by Josh Hertz on October 20th, 2020

INSTRUCTIONS


How to get started

  1. Fork and clone down this repo

  2. Open a terminal window and run npm install to install dependencies.

  3. Next, run npm start to start your server. In a separate terminal, use npm run build to start Webpack which will watch and auto-transpile your files. Make sure both of these terminal windows remain open and running

  4. Open a browser window and navigate to localhost:3000.


Overview of this repo

  • For this project, we'll be practicing our React skills to create a simple app which renders images of dogs to the screen and allows users to give each one a name.

Checklist of Features to Complete

Step 1: Connect your React app to the browser

  • Render App.jsx to our index.html.

Step 2: Start writing out App.jsx component

  • Create App as a stateful/class component.
  • Create a property of state to store an array of pup objects to be rendered to the screen.

Step 3: Create PupList.jsx and PupListEntry.jsx components

  • Create PupList and PupListEntry as functional components, using the provided comments within each file as a guide.

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

  • Render PupList within App, and PupListEntry within PupList

Step 4: Check your work

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

Step 5: Refactor PupList.jsx and PupListEntry.jsx for variable data

  • PupList should render one PupListEntry for each pup in the array in App's state

  • PupListEntry components should be able to conditionally render the pup's image based on what is passed down to it via props. Examine the shape of examplePupData.js to determine how to do this.


Step 6: Check your work

  • Set App's state to a real array of pups, by importing and using examplePupData.js
  • You should see a rendered list of 5 pups images displayed.

Step 7: Build functionality for user input

  • Refactor PupListEntry to be a stateful/class component. Add a state property which will store the user input and render it to the screen.

  • Add a Form within PupListEntry to allow users to input a name for each pup. Remember to provide a place for the name to render to the screen.

  • When completed, user input should be updated immediately after being typed into the input field.

OPTIONAL Add a Submit button that will only update the name after being clicked. You may need to add another state property to handle this.

Bonus Step: Replace dummy data with real data

  • Use the provided function in /lib/getPups.js to issue a GET request to the Dog API

  • Replace the examplePupData with the data received from the API call.

  • When completed, a page refresh should render 5 new pup images.

namethatpup's People

Contributors

jkhz 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.