yogeshtakeo / BFS33_files

0 stars 0 forks source link

Task 4 : Clock #6

Open yogeshtakeo opened 1 year ago

yogeshtakeo commented 1 year ago

Clock in JS

Objective

The objective of this exercise is to assess the participants' understanding and proficiency in using the useEffect hook in a React application.

Task Description

You are tasked with creating a simple clock component that displays the current time and updates every second.

Instructions

  1. Create a new React component named Clock.

  2. Inside the Clock component, import the useEffect and useState hooks from the React library.

  3. Use the useState hook to create a state variable named currentTime and initialize it with a default value of the current time.

  4. Display the currentTime value in the component's JSX.

  5. Use the useEffect hook to set up an interval that updates the currentTime every second.

  6. Within the useEffect hook, create a cleanup function that clears the interval when the component is unmounted.

  7. Customize the styling of the component using CSS or a CSS-in-JS solution of your choice.

  8. Test the Clock component by rendering it and verifying that it displays the current time and updates every second.

Additional Requirements

Git and GitHub

  1. Create a new GitHub repository for this exercise.

  2. Push your project to the GitHub repository.

  3. Take screenshots of the code in your Clock.js file and the rendered component.

  4. Go to the GitHub repository's issues section and create a new issue.

  5. In the issue's comment section, upload the screenshots of your code and the rendered component.

  6. Include the GitHub repository URL in the comment as well.

Submission

Share the screenshots of your code and the rendered component in the issue's comment section of your GitHub repository. Make sure to include the GitHub repository URL in the comment.

Note: Feel free to use any additional JavaScript or CSS features or syntax to enhance your solution. Provide comments where necessary to explain your code.

RoneshSingh commented 1 year ago

Annish https://github.com/RoneshSingh/clock

Image

Image

bjornbaniya commented 1 year ago

Bjorn Baniya https://github.com/bjornbaniya/Clock.git

Image

Image

onsever commented 1 year ago

Onurcan Sever Github Link: https://github.com/onsever/js-concept-4

Code Screenshot:

Image

Output Screenshot:

Image

shreeshakhadka commented 1 year ago

shreesha khadka task 4 https://github.com/shreeshakhadka/Clock

Image Image

Image

GM-Frost commented 1 year ago

Nayan Task: UseEffect Clock Git: https://github.com/GM-Frost/BFS33-Clock.git

Image

swskasingh commented 1 year ago

swastika singh https://github.com/swskasingh/clock.js.git

Image

YashKharel19 commented 1 year ago

YASH KHAREL TASK 4: CLOCK github: https://github.com/YashKharel19/clock

Image Image Image Image Image

ngawangsherpa commented 1 year ago

Ngawang Sherpa Task 4: Clock Github Link: https://github.com/ngawangsherpa/Clock

Image Image

poudelg25 commented 1 year ago

Gopal Poudel

https://github.com/poudelg25/Clock-in-JS.git

Screenshot 2023-07-07 at 3 44 23 PM