Self review: Passing props - React Basic

Self review: Passing props - React Basic

  1. True or False: In React, props is an object.

    • True

    • False

  2. True or False: You can pass a prop to a component by adding an attribute to the component being rendered, with the attribute’s value becoming the value of the passed-in prop

    • True

    • False

  3. What is the error in the code below?

     function Greeting() {
         return <h1>Hello, {props.name}</h1>
     }
     export default Greeting
    
    • The Greeting function should receive a props parameter.

    • You need to add extra spacing after the function's name.

    • You should always add a pair of parentheses after the return keyword.