Skip to main content

Knowledge check: State or stateless - React Basic

Updated 1 min readMarkdown
Part of seriesReact Basics
Knowledge check: State or stateless - React Basic
  1. What is a stateless component?

    • A component that doesn’t track its parent’s state.

    • A component that doesn’t track its own state.

  2. A stateful component must have a props object.

    • False

    • True

  3. To turn a stateless component into a stateful component, you must pass it a props object.

    • True

    • False

  4. The process of lifting up state can lead to: Select all that apply.

    • A stateful child component controlling the state of a stateful parent component.

    • A stateful child component controlling the state of a stateless parent component.

    • A stateful component becoming a stateless component.

    • A stateless component becoming a stateful component.

  5. A prop doesn't have to always pass state.

    • True

    • False

About the author

No comments yet. Be the first to comment.

React Basics

Part 6 of 18

In this module you will explore the basic structure and use of the React.js library. You will learn how to produce single page web applications using React components and to use JSX to style them.

Up nextSelf review: Managing state in ReactTrue or false? When lifting state up, you need to move the useState from a child component to a parent component. True. False. If the state variable holds an array or a string value, once you pass that state via props from a parent to a child, y...

More from this blog