fix(curriculum): modified instruction structuring (#50689)

Co-authored-by: Anmol Sarraf <anmolsarraf@Anmols-MacBook-Pro.local>
This commit is contained in:
Anmol Sarraf 2023-06-28 04:33:20 +10:00 committed by GitHub
parent ae16ebfd58
commit 758d46d70b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,11 +16,17 @@ The last challenge demonstrated how to pass information from a parent component
</ParentComponent>
```
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) => <p>{props.colors.join(', ')}</p>` This will join all `colors` array items into a comma separated string and produce: `<p>green, blue, red</p>` 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) => <p>{props.colors.join(', ')}</p>
```
This will join all `colors` array items into a comma separated string and produce: `<p>green, blue, red</p>`. 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--