Skip to content

Instantly share code, notes, and snippets.

@shameemreza
Created March 31, 2023 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shameemreza/8e6c342e93a283b66245f23ac25295e6 to your computer and use it in GitHub Desktop.
Save shameemreza/8e6c342e93a283b66245f23ac25295e6 to your computer and use it in GitHub Desktop.
Code for the "How to Render an Array of Objects in React?" Article.
import React from "react";
import EmployeeList from "./EmployeeList";
function App() {
const employees = [
{ name: "John Doe", age: 25, position: "Software Engineer" },
{ name: "Jane Smith", age: 32, position: "Product Manager" },
{ name: "Mike Johnson", age: 27, position: "UI/UX Designer" },
{ name: "Sarah Lee", age: 30, position: "Marketing Manager" },
];
return (
<div>
<h1>Employee List</h1>
<EmployeeList employees={employees} />
</div>
);
}
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment