How to show Fakestore API data in getBootstrap card component using react js
Fetch Data from the FakeStore API
Use fetch or axios to get data from the FakeStore API. Here's an example using the useEffect and useState hooks.
Explanation
- State and Fetching Data: - useStateinitializes an empty array for products.
- useEffectfetches data from the FakeStore API when the component mounts and updates the state.
 
- Bootstrap Grid System: - Use rowandcol-md-4for a responsive grid layout.
 
- Use 
- Bootstrap Cards: - Each product is displayed inside a cardwith an image, title, description, and price.
- The description is truncated for brevity.
 
- Each product is displayed inside a 
- Styling: 
- The image style ensures proper scaling within the card.
- Cards are responsive and look good on all screen sizes.
Run the App
Start the app with npm start. You should see a grid of Bootstrap cards 
displaying products from the FakeStore API.
 
 
 
