Knowledge check: Data flow

11. Usually, a React app consists of many components, organized as a component tree.

  • True
  • False

12. Uni-directional data flow is...

  • The term that describes the one-way flow of components in a React app
  • The term that describes the one-way flow of data in a React app.
  • The term that describes the one-way flow of DOM updates in a React app

13. A component can, at any given time_______. Select all that apply.

  • Receive data as props
  • Pass data as props
  • Pass data as props and receive data as props at the same time

14. You can only pass a single prop to a component.

  • True
  • False

15. The props parameter is:

  • An array
  • A string
  • An object
  • A boolean

16. Consider the following piece of code:

function MyMenu() {
return (
< div>
< Appetizers />
< /div>
)
}

Which element of this code represents a child component?

  • <div>
  • <Appetizers />
  • MyMenu()
  • return

Knowledge Check: State the concept

17. In React, can state be considered data?

  • Yes
  • No 

18. In React, can props be considered data?

  • Yes
  • No

Shuffle Q/A 2

19. Choose the correct statement.

  • The props object represents data that is external to a component, and state represents data that is internal to a component.
  • The props object represents data that is internal to a component, and state represents data that is external to a component.

20. What does the useState hook do?

  • It allows a component to receive state from its parent.
  • It allows a component to have its own state.

Leave a Reply