Challenge
In this challenge, we will create a react component that adds an item to an HTML list and displays it when a user presses the add button.
Your tasks are as follows:
- Initialize state variable
items
with an empty array. - Bind the given function
handleAddItem
in the constructor. - Loop over the variable items and display each in a list item.
Hints:
- Add it as you do in a JS object.
- Bind using
this.methodname.bind(this)
code - Refer to the JSX chapter.
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 1. Kapitel 10
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal
Awesome!
Completion rate improved to 3.13
Challenge
Svep för att visa menyn
In this challenge, we will create a react component that adds an item to an HTML list and displays it when a user presses the add button.
Your tasks are as follows:
- Initialize state variable
items
with an empty array. - Bind the given function
handleAddItem
in the constructor. - Loop over the variable items and display each in a list item.
Hints:
- Add it as you do in a JS object.
- Bind using
this.methodname.bind(this)
code - Refer to the JSX chapter.
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 1. Kapitel 10