Ready to get started?

Join Adocasts+ for $8/mo or sign into your account to get access to all of our lessons.

EdgeJS Components #2.2

Component Props and Default State

In this lesson, we'll learn how about props and how props and state interact within EdgeJS Components. We'll also take a look at how we can default default state values for our components.

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.

Join The Discussion! (0 Comments)

Please sign in or sign up for free to join in on the dicussion.