Q24.webp
L

Q24.webp

Kizspy | Question: 24
(Choose 1 answer)
FJOVERFLOW.COM
Which method can help ensure that updates in a function depend on the previous state in React?
A. const [count, setCount] = useState(0);
function increment() {
setCount(count + 1);
B. const [count, setCount] = useState(0);
function increment() {
}
setCount(count => count + 1);
C. const [count, setCount] = useState(0);
function increment() {
}
setCount(prevCount => prevCount + 1);
D. const [count, setCount] = useState(0);
function increment() {
}
setCount(count - 1);

Thông tin

Category
FER202
Thêm bởi
Luffy_san
Ngày thêm
Lượt xem
2,382
Lượt bình luận
7
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom