Read these instructions carefully to understand the requirements and functionalities for this project.
We Learned about using fetch
in our react application to make our first API Call.
The task for this project is to make a random image generator that shows a random image.
- Image Area to display image.
- Button to fetch new image on Click.
- Showing a Loader when the image is loading.
-
Clone this repo by using use template option with name of repo as
Mini-Project-ImageGenerator-Assignment
. -
Clone your created repo and work on it to push your code.
-
Use
githubbox.com
instead ofgithub.com
in your repository path, to create a synced codesandbox(always in sync with code in your repo). Read more here
- Create a Component
ImageDisplay
which has animg
tag and a loader (Loader can simply be textLoading....
as well ). - Create a button in the
App
Component with textGet New Image
and importImageDisplay
component in it. - Checkout the documentation at https://picsum.photos/ to know about how to use it for getting a random image.
- Use
fetch
to make an API call to theURL
from picsum documentation onGet New Image
Button click. - Display Loader/Image accordingly (show loader until image is fetched from api, once image is received, hide loader and show the image).
- Get first image automatically when your react app is Loaded from picsum api as well.
NOTE:
- Use of class component is strictly
not allowed
.
- Submit the Code Repo Link.
Deadline for Project - MONDAY , December 7, 12PM ( DAY 6)
Frontbench FullStack Camp is 12 weeks online camp to help people learn full-stack web development by building project. In 12 weeks, you build 12 (mini + major) project with 1:1 Mentor and peer community support.
To Know more and see our closed cohort sessions, visit --- LINK