Coder Social home page Coder Social logo

reactreviewwithpokemon's Introduction

reactReviewWithPokemon

Node version NPM version

Get additional practice with React by creating a front end application that renders data from pokemon api. This will require some knowledge on React

Getting Started

Clone

  $ git clone https://github.com/omegak911/reactReviewWithPokemon.git
  $ cd reactReviewWithPokemon

Setup

  $ npm install
  $ npm start
  $ npm run build

If you plan to redo this repo multiple times, make a new branch

  $ git checkout -b attempt1

When you are ready to try again, repeat as necessary

  $ git checkout master
  $ git checkout -b attempt2

Steps

At each step, before moving on, answer the following question: What justifies my expectation that I completed the requirement? If you cannot justify this, then it means you haven't tested it yet.

STEP 1:

Connect your react app to the browser

STEP 2:

Render all the components + validate that they are all connected properly

STEP 3:

Pass mock pokemon data down to App as props + render said data

  • this will require you to set props to state, do not do this in the constructor
  • set props to your state once your component mounts

STEP 4:

Design Search.js such that a user can input data and on submit, run a function that console.log's what the user has submitted so far

STEP 5:

Using axios + https://pokeapi.co/, complete the lib/getPokemon.js function

  • hint: google "npm axios" to find out the syntax for a GET request

STEP 6:

Pass getPokemon function to App + configure the app so that when user submits, it will run getPokemon function instead of the console.log

STEP 7:

As needed, update getPokemon.js so that pokemon data received from the API will render on the page in addition to any existing pokemon data

  • remove the mock data

Advanced

Note: if you're not comfortable with STEPS 1-7, redo STEPS 1-7 instead

STEP 8:

Create a new feature

STEP 9:

Add css, you may use this as reference https://www.pokemon.com/us/pokedex/

STEP 10:

On mount, render the original 151 pokemon, in the correct order

STEP 11:

PokemonListItem should only re-render if an applicable change has occurred. They should NOT all re-render on every unrelated change

STEP 12:

Refactor application to use Redux or Context API instead of passing props down manually

Solutions

Once you are done with steps 1-7, solution code is available on branch solution1

  $ git checkout solution1

I've included some additional solution code and techniques on branch solution2. Probably don't look at this until you have the basics down and have completed some/all of the advanced content

  $ git checkout solution2

Acknowledgments

reactreviewwithpokemon's People

Contributors

omegak911 avatar

Watchers

James Cloos 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.