Knowledge check: Advanced Hooks - Advanced React

Knowledge check: Advanced Hooks - Advanced React

  1. True or false: useReducer is a reducer function that takes in the initial state and an action and returns the new state.

    • True

    • False

  2. True or false: The useState hook is best suited for complex state logic or when the next state depends on the previous one.

    • True

    • False

  3. A common scenario for using the useRef hook is to...

    • ...focus the cursor into an input field.

    • ...control a component's state.

    • ...handle side effects.

    • ...memorize expensive operations.

  4. True or false: Building your own Hooks lets you extract component logic into reusable functions

    • True

    • False

  5. The useState hook gives us a reliable way to...

    • ... deal with state updates in React components.

    • ... deal with state updates in React prompts.

    • ... deal with state updates in React dependency arrays.

    • ... deal with state updates in React useEffect invocations.