Skip to content

Latest commit

 

History

History
58 lines (42 loc) · 899 Bytes

File metadata and controls

58 lines (42 loc) · 899 Bytes

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