Ready to get started?

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

robot mascot smiling

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.

Published
Oct 29, 23
Duration
3m 43s

Developer, dog lover, and burrito eater. Currently teaching AdonisJS, a fully featured NodeJS framework, and running Adocasts where I post new lessons weekly. Professionally, I work with JavaScript, .Net C#, and SQL Server.

Adocasts

Burlington, KY

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) }}

Ready to get started?

Join Adocasts Plus for $8.00/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.

robot comment bubble

Be the first to Comment!