A

Admin • 833.24K Points
Coach

Q. Which of these is a valid way to pass props to a component?

Code:
<MyComponent title="React" />
  • (A) title: 'React'
  • (B) MyComponent.props('React')
  • (C) <MyComponent title="React" />
  • (D) MyComponent[title='React']
  • Correct Answer - Option(C)
  • Views: 26
  • Filed under category React JS
  • Hashtags:

Explanation by: Admin

Props are passed to components using JSX attributes like in HTML.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.