Skip to content

Code-lab-web/exercise-dog-facts-use-effect-hook

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Dog Facts useEffect Hook Exercise

For this weeks practice you will practice using the useEffect hook to create a simple app that will use an external free API to retrieve Dog Facts.

"The better I get to know men, the more I find myself loving dogs." - Charles de Gaulle

Instructions:

Fetch the data from the Dog Facts free API JSON File and pass down the data from the parent component to its child component. We've created the necessary components for you, now it's up to you to pass the prop properly to the DogFact.jsx component. Keep in mind that this exercise's repository styles.css is empty, and feel free to add CSS if you'd like—it's encouraged! The primary focus here remains to master the useEffect hook and efficiently passing data received from the API into different components via props in React.

API

https://dogapi.dog/api/v2/facts

Getting Started with the Project

Dependency Installation & Startup Development Server:

Once cloned, navigate to the project's root directory and this project uses npm (Node Package Manager) to manage its dependencies.

The command below is a combination of installing dependencies, opening up the project on VS Code and it will run a development server on your terminal.

npm i && code . && npm run dev

About

A simple React app utilising the useEffect hook to fetch and display Dog Facts from an external API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 84.3%
  • HTML 14.4%
  • CSS 1.3%