From 758d46d70b5a2c42552b817e4dfc9593df0a9768 Mon Sep 17 00:00:00 2001 From: Anmol Sarraf Date: Wed, 28 Jun 2023 04:33:20 +1000 Subject: [PATCH] fix(curriculum): modified instruction structuring (#50689) Co-authored-by: Anmol Sarraf --- .../react/pass-an-array-as-props.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/curriculum/challenges/english/03-front-end-development-libraries/react/pass-an-array-as-props.md b/curriculum/challenges/english/03-front-end-development-libraries/react/pass-an-array-as-props.md index b67008a084b..f9c089485a2 100644 --- a/curriculum/challenges/english/03-front-end-development-libraries/react/pass-an-array-as-props.md +++ b/curriculum/challenges/english/03-front-end-development-libraries/react/pass-an-array-as-props.md @@ -16,11 +16,17 @@ The last challenge demonstrated how to pass information from a parent component ``` -The child component then has access to the array property `colors`. Array methods such as `join()` can be used when accessing the property. `const ChildComponent = (props) =>

{props.colors.join(', ')}

` This will join all `colors` array items into a comma separated string and produce: `

green, blue, red

` Later, we will learn about other common methods to render arrays of data in React. +The child component then has access to the array property `colors`. Array methods such as `join()` can be used when accessing the property. + +```jsx +const ChildComponent = (props) =>

{props.colors.join(', ')}

+``` + +This will join all `colors` array items into a comma separated string and produce: `

green, blue, red

`. Later, we will learn about other common methods to render arrays of data in React. # --instructions-- -There are `List` and `ToDo` components in the code editor. When rendering each `List` from the `ToDo` component, pass in a `tasks` property assigned to an array of to-do tasks, for example `["walk dog", "workout"]`. Then access this `tasks` array in the `List` component, showing its value within the `p` element. Use `join(", ")` to display the `props.tasks` array in the `p` element as a comma separated list. Today's list should have at least 2 tasks and tomorrow's should have at least 3 tasks. +There are `List` and `ToDo` components in the code editor. When rendering each `List` from the `ToDo` component, pass in a `tasks` property assigned to an array of to-do tasks, for example `["walk dog", "workout"]`. Then access this `tasks` array in the `List` component, showing its value within the `p` element. Use `join(", ")` to display the `props.tasks` array in the `p` element as a comma-separated list. Today's list should have at least 2 tasks and tomorrow's should have at least 3 tasks. # --hints--