yogeshtakeo / BFS33_files

0 stars 0 forks source link

Task 3c : Todo #5

Open yogeshtakeo opened 1 year ago

yogeshtakeo commented 1 year ago

Simple Todo ( Adding Bonus )

Objective

The objective of this exercise is to assess the participants' understanding and proficiency in using the useState hook and working with component props in a React application.

Hint : Look for onClick event, Look for onChange event for input feild. you can also look up Form Handling

Task Description

You are tasked with creating a simple todo list component that allows users to add and remove tasks. The tasks will be passed to the component as a prop.

Instructions

  1. Create a new React component named TodoList.

  2. Define a functional component named TodoList that takes a single prop named tasks.

  3. Inside the TodoList component, use the useState hook to create a state variable named todoItems and initialize it with the value of the tasks prop.

  4. Display the list of tasks in the component's JSX using an appropriate HTML element (e.g., ul or div).

  5. Add an input field and a button labeled "Add" to allow users to enter new tasks. Bind the value of the input field to a new state variable named newTask.

  6. Create a function that handles the addition of new tasks. This function should update the todoItems state by adding the new task to the existing list of tasks.

  7. Attach the function from step 6 to the button's onClick event to trigger the addition of new tasks when the button is clicked.

  8. Customize the styling of the component and the task list using CSS or a CSS-in-JS solution of your choice.

  9. Test the TodoList component by rendering it with different initial tasks and verifying that new tasks can be added and removed correctly.

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 TodoList.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/Todos

Image

Image

onsever commented 1 year ago

Onurcan Sever Task 3c: Todo Github Link: https://github.com/onsever/js-concept-3c

Code Screenshot:

Image

Output Screenshot:

Image

GM-Frost commented 1 year ago

Nayan Task: Todo List Git: https://github.com/GM-Frost/BFS33-TodoList.git

Image

Image

bjornbaniya commented 1 year ago

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

Image

Image

ngawangsherpa commented 1 year ago

Ngawang Sherpa Task 3c Github Link: https://github.com/ngawangsherpa/Todo/tree/main/Todo/src

Image

Image

shreeshakhadka commented 1 year ago

Shreesha khadka task 3 c https://github.com/shreeshakhadka/USESTATE3C

Image Image