Skip to content

Where are the appearanceChanged and defaultSlottedContentChanged lifecycle methods documented? #6690

Answered by KingOfTac
logan2z asked this question in Q&A
Discussion options

You must be logged in to vote

The methods you're referring to aren't lifecycle methods that are available to every component, rather they can be optionally added to respond to changes to any @attr and @observable decorated properties on the component.

The shape these methods take is [property_name]Changed and they take two arguments for the previous value of the property and the new value.

A concrete example using the latest fast-element beta.

import { customElement, html, slotted, elements, FASTElement } from '@microsoft/fast-element';

@customElement({
  name: 'my-list',
  template: html<List>`
    <h3>${x => x.heading}</h3>
    <ul>
      <slot
        ${slotted({ property: 'slottedItems', filter: elements('[role="…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by KingOfTac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants