From c8a3d7e9e3708006882dac91c212304046e31dd5 Mon Sep 17 00:00:00 2001 From: Emanuel Quintino Date: Wed, 6 Dec 2023 18:19:46 -0300 Subject: [PATCH] update examples class components --- 6-React/class-02-components/src/pages/App.tsx | 10 +++++++++- 6-React/class-03-states/README.md | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/6-React/class-02-components/src/pages/App.tsx b/6-React/class-02-components/src/pages/App.tsx index 4e27be24..56f6cf8c 100644 --- a/6-React/class-02-components/src/pages/App.tsx +++ b/6-React/class-02-components/src/pages/App.tsx @@ -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 ( <>

Class Components

- + {users.map(({ id, gitHub, name, age }) => { + return ; + })} ); } diff --git a/6-React/class-03-states/README.md b/6-React/class-03-states/README.md index b18233bf..9ca5fa54 100644 --- a/6-React/class-03-states/README.md +++ b/6-React/class-03-states/README.md @@ -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)