From a3d5c169e81d14b3d19828da7f86177d8ccbfbd4 Mon Sep 17 00:00:00 2001 From: Ciper100 <97075159+Ciper100@users.noreply.github.com> Date: Sat, 21 Jan 2023 16:37:28 +0545 Subject: [PATCH] corrected the faulty code of React documentaion --- content/docs/components-and-props.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/content/docs/components-and-props.md b/content/docs/components-and-props.md index 92661b9dc18..1719fcb583a 100644 --- a/content/docs/components-and-props.md +++ b/content/docs/components-and-props.md @@ -154,11 +154,11 @@ This component can be tricky to change because of all the nesting, and it is als First, we will extract `Avatar`: ```js{3-6} -function Avatar(props) { +function Avatar({user}) { return ( {props.user.name} ); } @@ -194,12 +194,12 @@ function Comment(props) { Next, we will extract a `UserInfo` component that renders an `Avatar` next to the user's name: ```js{3-8} -function UserInfo(props) { +function UserInfo({user}) { return (
- +
- {props.user.name} + {user.name}
);