For my latest project, I developed a basic todo application using React. One of the key features is that when a user clicks on a checkbox, the corresponding todo item's CSS changes to show a strike-through effect. Additionally, a button appears on hover which allows users to delete the specific todo item.
Currently, I am looking to implement two new functionalities:
- Modify the CSS of the entire list of todos upon clicking an 'x' event using React.
- Adjust the CSS of individual todos when clicking on the respective list item.
Below is a snippet of my app code:
class App extends Component {
constructor(){
super();
this.state={
todo:[]
};
};
...
I have added a method called "allDone()" and attached it to the span element 'X' via onClick event. However, I am encountering issues in changing the CSS of all elements in the list to display them as strikethrough. Check out the image here.