Skip to content

Commit

Permalink
update examples class components
Browse files Browse the repository at this point in the history
  • Loading branch information
EmanuelQuintino committed Dec 6, 2023
1 parent e4d027a commit c8a3d7e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion 6-React/class-02-components/src/pages/App.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
import { CardProfile } from "../components/CardProfile";

const users = [
{ id: 1, gitHub: "EmanuelQuintino", name: "Emanuel Quintino", age: 30 },
{ id: 2, gitHub: "EmanuelQuintino", name: "Emanuel Quintino", age: 30 },
{ id: 3, gitHub: "EmanuelQuintino", name: "Emanuel Quintino", age: 30 },
];

export function App() {
return (
<>
<h1 style={{ textAlign: "center" }}>Class Components</h1>
<CardProfile gitHub={"EmanuelQuintino"} name={"Emanuel Quintino"} age={30} />
{users.map(({ id, gitHub, name, age }) => {
return <CardProfile gitHub={gitHub} name={name} age={age} key={id} />;
})}
</>
);
}
2 changes: 1 addition & 1 deletion 6-React/class-03-states/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Rendering Flow

- When the status changes
- When the state changes
- When the property changes
- When parent component renders
- Passing function is different from executing (infinite rendering)
Expand Down

0 comments on commit c8a3d7e

Please sign in to comment.