Skip to content

Instantly share code, notes, and snippets.

View quantumchuckles's full-sized avatar
🎯
Focusing

Shyam Pawar quantumchuckles

🎯
Focusing
View GitHub Profile
@quantumchuckles
quantumchuckles / Loop.js
Created January 26, 2021 07:33
For-loop in JSX with id
const Loop = () => {
const animals = [
{ id: 1, animal: "Dog" },
{ id: 2, animal: "Bird" },
{ id: 3, animal: "Cat" },
{ id: 4, animal: "Mouse" },
{ id: 5, animal: "Horse" },
];
return (
@quantumchuckles
quantumchuckles / Rfor.js
Created January 22, 2021 08:58
For-loop in JSX
import React from "react";
const RFor = ({ data, renderItem }) => {
return data.map((item) => renderItem(item));
};
const data = ["i1", "i2", "i3", "i4", "i5", "i6", "i7", "i8", "i9", "i10"];
const Box = ({ item }) => (
<div>