From 5b693c4f01d417d56aabb3180b67dcaf541441bd Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Mon, 25 May 2026 23:28:42 +0200 Subject: [PATCH] Format code examples in react.md for improved readability and consistency --- docs/react.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/react.md b/docs/react.md index f07f4fdc..57ae4546 100644 --- a/docs/react.md +++ b/docs/react.md @@ -506,16 +506,16 @@ function Button() { // Types interface ProfileProps { profile: Profile - invertedMbtiChoice: string // ✅ a prop, not a second parameter + label: string // a prop, not a second parameter } // Component -export function ProfilePersonality({profile, invertedMbtiChoice}: ProfileProps) { +export function ProfilePersonality({profile, label}: ProfileProps) { // Hook — stateful logic const [isExpanded, setIsExpanded] = useState(false) // Derived value — plain calculation, not a hook - const mbtiType = profile.mbti ? invertedMbtiChoice : null + const mbtiType = label + '-MBTI' // Effect — side effect (lifecycle) useEffect(() => { @@ -545,8 +545,8 @@ export function ProfilePersonality({profile, invertedMbtiChoice}: ProfileProps) ``` JavaScript ├── Everything is an object (or behaves like one) -├── Classes are functions with prototype chains ├── Functions are first-class objects +├── Classes are functions with prototype chains └── Async model: single-threaded + event loop ↓ adds