In this article, I will be showing you how to map components in React JS
Purpose of mapping components to data:
Instead of writing every single component again and again for every single data, we can map components to the data easily by creating an array and map them with map()
function and will fetch every single data in an array to a single component
For example:
let arr = [1,2,3,4,5]
const sum = arr.map((e)=>{
return (e+1);
});
It will add the number to the 1 to every single number inside array arr
. This same logic applies in React component mapping, and for that I have made a video on that so make sure to check that 👇
So, this was it; I hope that this article/video might be helpful to you
Top comments (4)
Thank You, The video has really help me...
You're welcome 🙂 Thanks for watching!
Have a great day!
thanks for the tutorial!
You're welcome Serdar