React project demonstrating the use of the Fetch API to perform HTTP requests.
- Fetch API integration with React
- State management with hooks (useState, useEffect)
- Error handling in requests
- REST API consumption
npm installnpm run start├── src/
│ ├── components/ # React components
│ ├── hooks/ # Custom hooks
│ ├── pages/ # Main pages
│ ├── App.jsx
│ └── index.js
├── public/
└── package.json
- React
- Fetch API
- JavaScript ES6+
useEffect(() => {
fetch("https://api.example.com/data")
.then((res) => res.json())
.then((data) => setData(data))
.catch((err) => console.error(err));
}, []);MIT