Test your knowledge

  1. Which of the following best describes the prop-types package?
    1. A strongly typed JavaScript utility for compiling React components.
    2. A tool to validate prop values that are passed to components during development.
    3. A tool to validate prop values that are passed to components in production.
  2. How do you validate that a property value is something that can be rendered?
    1. If it has a toString() function, this is enough to render it.
    2. Use the PropTypes.node validator.
    3. Use the PropTypes.renderable validator.
  3. What is the purpose of the PropTypes.shape validator?
    1. To make sure that an object has certain properties with certain types, ignoring any additional properties.
    2. To make sure that an object passed as a prop is of a particular class.
    3. To make sure that an object has certain property names.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.15.248