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.
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
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;
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?
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.
I just want to say you have saved me SO MUCH time with your coding vids so thank you man
Thank you very much bro
1:10 isn’t it division not development
I found you accidentally ❤
very good
for deleting the elements can we use updater functions as well? like setFoods((f) => f.filter((_, i) => i !== index));
Now i am pro in react pls do redux i will share this vid as possible
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
thanks for your vids man, they are truly helpful 🙏 love from Argentina❤
can you please create a video about how can your website send an email to someone?
Bro Code your my favorite youtuber. Keep up this good work.
bro how many languages do you know
Hey Bro code do you do a cybersecurity tutorial too ?
Please make Reactjs projects as well
Code bro i love u
Good Explanation bro
Great 🎉
Amazing video i learned alot about ARRAYS in state
Thanks for the video as always, bro
The Best Coding Channel ever Thank you Bro code✌🙏