# Lightning Web Components: decorators, lifecycle, events and data

*Platform Developer Study Guide · User Interface · Last updated October 15, 2026 · https://www.certifyforce.com/study-guide/platform-developer/user-interface/lightning-web-components-framework-events-data*

How a Lightning web component is built and wired: the @api, @track and @wire decorators, the lifecycle hooks, custom events and their propagation, Lightning Message Service, Lightning Data Service forms and adapters, styling and Aura interoperability.

- Certification: Salesforce Platform Developer
- Exam section: User Interface
- Study guide: https://www.certifyforce.com/study-guide/platform-developer

**Official exam objective:**

> Describe the use cases and best practices for Lightning Web Components, including the framework, benefits, and events.

## What the exam expects

- Explain the framework's benefits and how LWC and Aura coexist and nest.
- Pick `@api`, `@track` or `@wire`, and fix a component that doesn't rerender.
- Place work in the right lifecycle hook.
- Choose the communication pattern from where components sit, and name, configure and dispatch custom events by the documented best practices.
- Use Lightning Data Service before custom code, and load styling and third-party libraries correctly.

Key terms: **custom event** (a `CustomEvent` dispatched to ancestors), **shadow boundary** (the line encapsulating a component's DOM and CSS), **wire adapter** (a data source `@wire` subscribes to), **Lightning Data Service** (the shared client record cache), **message channel** (the topic Lightning Message Service publishes to).

## Key facts

| Fact | Detail | Source |
|---|---|---|
| Nesting direction | Aura can contain LWC; LWC can't contain Aura | [Aura Coexistence](https://developer.salesforce.com/docs/platform/lwc/guide/interop-intro.html) |
| Field reactivity | All fields reactive since Spring '20; `@track` only for object properties or array elements | [Decorators](https://developer.salesforce.com/docs/platform/lwc/guide/reference-decorators.html) |
| Constructor | No public property values or child elements yet | [Component Is Created](https://developer.salesforce.com/docs/platform/lwc/guide/create-lifecycle-hooks-created.html) |
| `renderedCallback()` | After every render, child to parent | [Component Renders](https://developer.salesforce.com/docs/platform/lwc/guide/create-lifecycle-hooks-rendered.html) |
| Event defaults | `bubbles: false`, `composed: false`; bubbling phase only | [Event Propagation](https://developer.salesforce.com/docs/platform/lwc/guide/events-propagation.html) |
| Event names | No uppercase, no spaces, underscores between words, no `on` prefix | [Create Events](https://developer.salesforce.com/docs/platform/lwc/guide/events-create-dispatch.html) |
| Across regions | Lightning Message Service, also reaching Aura and Visualforce on the page | [Message Service](https://developer.salesforce.com/docs/platform/lwc/guide/use-message-channel.html) |
| LDS cost | No API usage calls; respects CRUD, FLS and sharing | [Lightning Data Service](https://developer.salesforce.com/docs/platform/lwc/guide/data-ui-api.html) |
| Third-party JavaScript | Static resource plus `loadScript` | [Third-Party Libraries](https://developer.salesforce.com/docs/platform/lwc/guide/js-third-party-library.html) |

## Check yourself

- Why does a component fail to rerender after `this.order.status = 'Closed'`?
- When should a component use Lightning Message Service instead of a custom event?
- Why send primitives, or a copy, in an event's `detail`?
- Which base component builds a layout-driven create and edit form without Apex?

## Sources

- [Communicate with Events](https://developer.salesforce.com/docs/platform/lwc/guide/events.html)
- [Create and Dispatch Events](https://developer.salesforce.com/docs/platform/lwc/guide/events-create-dispatch.html)
- [Events Best Practices](https://developer.salesforce.com/docs/platform/lwc/guide/events-best-practices.html)
- [Handle Events in Lightning Web Components](https://trailhead.salesforce.com/content/learn/modules/lightning-web-components-basics/handle-events-in-lightning-web-components)
- [Configure Event Propagation](https://developer.salesforce.com/docs/platform/lwc/guide/events-propagation.html)
- [Get Started with Lightning Web Components](https://developer.salesforce.com/docs/platform/lwc/guide/get-started-introduction.html)
- [Decorators](https://developer.salesforce.com/docs/platform/lwc/guide/reference-decorators.html)
- [Reactivity for Fields, Objects, and Arrays](https://developer.salesforce.com/docs/platform/lwc/guide/reactivity-fields.html)
- [Set Properties on Child Components](https://developer.salesforce.com/docs/platform/lwc/guide/create-components-data-binding.html)
- [Call Methods on Child Components](https://developer.salesforce.com/docs/platform/lwc/guide/create-javascript-methods.html)
- [Run Code When a Component Is Created](https://developer.salesforce.com/docs/platform/lwc/guide/create-lifecycle-hooks-created.html)
- [Run Code When a Component Is Inserted or Removed from the DOM](https://developer.salesforce.com/docs/platform/lwc/guide/create-lifecycle-hooks-dom.html)
- [Run Code When a Component Renders](https://developer.salesforce.com/docs/platform/lwc/guide/create-lifecycle-hooks-rendered.html)
- [Handle Component Errors](https://developer.salesforce.com/docs/platform/lwc/guide/create-lifecycle-hooks-error.html)
- [Understand the Wire Service](https://developer.salesforce.com/docs/platform/lwc/guide/data-wire-service-about.html)
- [Lightning Data Service](https://developer.salesforce.com/docs/platform/lwc/guide/data-ui-api.html)
- [Compare Base Components](https://developer.salesforce.com/docs/platform/lwc/guide/data-get-user-input.html)
- [Lightning Message Service](https://developer.salesforce.com/docs/platform/lwc/guide/use-message-channel.html)
- [Aura Coexistence](https://developer.salesforce.com/docs/platform/lwc/guide/interop-intro.html)
- [Compose Aura Components from Lightning Web Components](https://developer.salesforce.com/docs/platform/lwc/guide/interop-aura-composition.html)
- [Use the Wire Service to Get Data](https://developer.salesforce.com/docs/platform/lwc/guide/data-wire-service.html)
- [Style Components with CSS Stylesheets](https://developer.salesforce.com/docs/platform/lwc/guide/create-components-css.html)
- [Use Third-Party JavaScript Libraries](https://developer.salesforce.com/docs/platform/lwc/guide/js-third-party-library.html)

## About the full unit

The "Core concepts", "Exam traps" and "Worked scenario" sections of this unit, its 21 linked practice questions, and unlimited timed mock exams are included with the Platform Developer pack (USD $19): https://www.certifyforce.com/practice-exams
