Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in example solution part1 (coursedata) #2933

Open
Morred opened this issue Jun 7, 2023 · 0 comments
Open

Error in example solution part1 (coursedata) #2933

Morred opened this issue Jun 7, 2023 · 0 comments
Labels

Comments

@Morred
Copy link

Morred commented Jun 7, 2023

In /coursedata/src/App.js, the Content component passes exercises1 as a prop each time it calls the Part component. However, the Part component tries to use props.exercises instead. Thus, the actual number is not rendered.

Code:

...
const Part = (props) => {
  return (
    <p>
      {props.part} {props.exercises}
    </p>
  )
}

const Content = (props) => {
  return (
    <div>
      <Part part={props.part1} exercises1={props.exercises1} />
      <Part part={props.part2} exercises1={props.exercises2} />
      <Part part={props.part3} exercises1={props.exercises3} />
    </div>
  )
}
...

Result:
Screenshot 2023-06-07 at 10 53 54

@vejol vejol added the part 1 label Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants