GithubHelp home page GithubHelp logo

reactminichallenge's Introduction

ReactMiniChallenge

Fill in the the incomplete files to complete a React app that displays random animal facts. Follow the errors in your browser, and make the tests pass complete this app. You'll be working in the following files:

  • App.jsx
  • FactsList.jsx
  • Fact.jsx

Requirements

It is reccomended to complete the requirements in an order similar to the outline below:

ORDER DESCRIPTION
1 Create a class component, App, in the App.jsx file which holds the animal facts (from data.jsx file) in state
2 Pass the animal facts down from the App component to the FactsList component
TIP Use chrome dev tools for React to check the values of state and props in each component as you work through this challenge...or console.log to check
3 In FactsList.jsx, dynamically render the data HINT: use the map method to render each item in the data array to a Fact component
4 Fill in the Fact component with the data that's been passed down through props. Consider what data type a single item from the animalFacts array in data.jsx is
5 Create an event handler function called handleFavoriteClick in App.jsx which updates the state of favorite with the name of the animal that is favorited
TIP Start by just adding a console.log statemet like console.log(Clicked!) in the handleFavoriteClick function to see if you can get the function to fire
6 Pass the handleFavoriteClick method down from the App component to the Fact component
7 Connect handleFavoriteClick to an onClick event attached to the button in Fact.jsx. HINT: add a value property to the button and set equal to the animal name
TIP You can console.log(e.target.value) in the handleFavoriteClick function to check if you've set the correct value for the Favorite button onClick event

Demo

Dec-03-2020 22-51-20

Installation

To get started:

Navigate to the project Directory

$ cd ReactMiniChallenge

Install the dependencies

$ npm install

Start the dev server

$ npm run dev-server

Check if tests are passing

$ npm run test

Technologies

React Express Webpack Babel Jest Enzyme

reactminichallenge's People

Contributors

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