tiennguyen3354 / InventoryApp

The **Inventory Tracker** is a web application designed to manage categories, items, and drinks. It allows users to categorize items, track inventory levels, and associate drinks with items, making it suitable for restaurants, cafes, or any business that manages inventory.
0 stars 0 forks source link

Make a custom hook for fetch in react #1

Open tiennguyen3354 opened 3 weeks ago

tiennguyen3354 commented 3 weeks ago

The hook will accept a URL and other optional parameters (like request options) for flexibility. It will use useEffect to trigger the fetch request when the component mounts or when the URL changes. The useState hook will be used to manage data, loading status, and errors.

tiennguyen3354 commented 3 weeks ago

dont forget about the abort for a cleaner custom hook