Skip to content

PzD3v/Fetch-API-React

Repository files navigation

Fetch-API-React

Description

React project demonstrating the use of the Fetch API to perform HTTP requests.

Features

  • Fetch API integration with React
  • State management with hooks (useState, useEffect)
  • Error handling in requests
  • REST API consumption

Installation

npm install

Usage

npm run start

Project Structure

├── src/
│   ├── components/    # React components
│   ├── hooks/         # Custom hooks
│   ├── pages/         # Main pages
│   ├── App.jsx
│   └── index.js
├── public/
└── package.json

Technologies

  • React
  • Fetch API
  • JavaScript ES6+

Example

useEffect(() => {
  fetch("https://api.example.com/data")
    .then((res) => res.json())
    .then((data) => setData(data))
    .catch((err) => console.error(err));
}, []);

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors