Props


  • What do props provide to a parent component?
  • What macro do we call to define/declare a prop?

 

  • What naming convention should we use when defining props that have multi-word names?
  • What is the attribute that a parent should use for a child prop named firstName?

 

  • How does a parent set the value of a child prop to the value of a String literal?
  • How does a parent set the value of a child prop to the value of a ref defined in the parent’s <script setup>?
  • How does a parent set the value of a child prop to any expression that is not a String literal?
  • Suppose you have a ref that contains an object that holds all of the props of a child. How can you use pass all of the props using the object.

 

  • Do props establish a one-way or 2-way data flow between a parent and a child component?
  • If a parent sets a prop to a ref, and later changes the value in the ref, will the child prop recognize the change?
  • Can a child component modify the value of a prop whose type is primitive (String, Number, Boolean)?
  • Can a child component modify the contents of a prop whose type is Array or Object?
  • Should a child component modify the contents of a prop whose type is Array or Object?
  • Can you define a prop to be able to hold values of multiple types?
  • What are the 4 keys that can be used when defining a prop using an object in defineProps().