ey man, u and js mastery are the two most underrated creators i've seen u two deserve waay more subscribers than this tnx for all your efforts man . love ya
Hello bro code, you are truly a professor. I miss you very much. Thank you. I have a question. If you want to add the item to Array exam:function addItemCorrect(item) { setItems(prevItems => [...prevItems, item]); // This correctly creates a new array. } its not work to add array i see this way in site mastering react to do that just your way to add array or what please answer me
Guys! You all Thank Bro like me for his effort to provide this awesome materials, so hasn’t the time come for us to thank our lord Allah who gives us an awesome brain to understand this masterpiece :) I really hope you all to wardship allah by the way he wants.
import React, { useState } from 'react';
function MyComponent() {
const [foods, setFoods] = useState(["Apple", "Orange", "Banana"]);
function handleAddFood(){
const newFood = document.getElementById("foodInput").value;
document.getElementById("foodInput").value = "";
setFoods(f => [...f, newFood]);
}
function handleRemoveFood(index){
setFoods(foods.filter((_, i) => i !== index));
}
return (
List of Food
{foods.map((food, index) =>
handleRemoveFood(index)}>
{food}
)}
Add Food
);
}
export default MyComponent;
I just want to say you have saved me SO MUCH time with your coding vids so thank you man
ey man, u and js mastery are the two most underrated creators i've seen
u two deserve waay more subscribers than this
tnx for all your efforts man . love ya
Bro Code your my favorite youtuber. Keep up this good work.
thanks for your vids man, they are truly helpful 🙏 love from Argentina❤
Amazing video i learned alot about ARRAYS in state
Thanks for the video as always, bro
Bro, why use document.getElementById in React???
it is still javascript
I know but it's vanilla javascript. Very tedious.
@@RychAhlberg and what we can use?
Hello bro code, you are truly a professor. I miss you very much. Thank you. I have a question. If you want to add the item to Array
exam:function addItemCorrect(item) {
setItems(prevItems => [...prevItems, item]); // This correctly creates a new array.
}
its not work to add array
i see this way in site mastering react to do that just your way to add array or what
please answer me
Guys! You all Thank Bro like me for his effort to provide this awesome materials, so hasn’t the time come for us to thank our lord Allah who gives us an awesome brain to understand this masterpiece :) I really hope you all to wardship allah by the way he wants.
Good Explanation bro
Thank you very much bro
for deleting the elements can we use updater functions as well? like setFoods((f) => f.filter((_, i) => i !== index));
Please make Reactjs projects as well
The Best Coding Channel ever Thank you Bro code✌🙏
very good
can you please create a video about how can your website send an email to someone?
Hey Bro code do you do a cybersecurity tutorial too ?
1:10 isn’t it division not development
Great 🎉
bro how many languages do you know
I found you accidentally ❤
Code bro i love u
Now i am pro in react pls do redux i will share this vid as possible