Props allow us to pass data from outside our component into the component's state. They're incredibly useful for setting default values and propagating state through different levels of our components.
Understanding Props
Props are set directly on a $props
object within the state of our component. However, they are also readily available directly off the state itself, which is just called state
.
To see the entirety of our component state, you can wrap it in an inspect call, which will pretty-print it on our document.
{{ inspect(state) }}
Copied!
Ready to get started?
Join Adocasts+ for $8/mo or sign into your account to get access to all of our lessons.