this.props. Props must be defined using camel-case but set as kebab-case in HTML.
Props will be observed by default which means they react to changes.
<example-component class-name="a-class" required="true"></example-component>
You'll need to define your prop types in the component definition, like so:
required: true, // is this required?
observed: false // turn off observing changes to this prop
The following properties can be used to define props:
|yes||This must be one of |
|Set a default value if one is not set|
|Is this prop required when the component is used? If so, set to |
|Set to |
Instance properties #
const exampleComponentInstance = document.querySelector('example-component')
exampleComponentInstance.className = 'another-value'