Salesforce's Summer '26 release makes the @lwc/state module generally available for Lightning Web Components. It introduces a first-class reactive state management pattern using defineState, atoms, computed values, and setAtom — eliminating prop drilling, custom events, and pub/sub workarounds. State can be shared across component trees via fromContext. The release also ships built-in lightning namespace state managers for Salesforce data (records, objectInfo, layouts, related lists) built on Lightning Data Service and UI API. State managers are plain JS modules, making them unit-testable with Jest without mounting components. Two example projects are available on GitHub and StackBlitz.

5m read timeFrom developer.salesforce.com
Post cover image
Table of contents
Defining state in LWC with defineStateSharing state across a component tree with fromContextBuilt-in state managers for Salesforce dataSee state managers in actionMore resourcesAbout the Authors
707 Impressions