Subscribes to changes on the selected component. The callback runs whenever the component's data, styles, state, preset, or other manifest-driven values change, including changes made outside your panel, such as through an auto panel or another custom panel.
This is useful when your panel's fields overlap with fields a Wix user can also edit elsewhere, and you need your panel's UI to reflect the current value rather than the value it had when the panel opened.
onChange() is only available from your custom panel's own code, not from your component's own render code. Your component doesn't need it: the editor already re-renders it with updated props whenever a bound value changes.
| Name | Type | Description |
|---|---|---|
callback | function | Called with a patch object whenever the component changes. patch.type indicates what changed, such as 'data', 'styles', 'state', 'preset', 'props', 'manifest', 'bindings', or 'providers'. patch.value contains the updated value. |
Promise<() => void>
An unsubscribe function. Call it to stop listening for changes, for example when your panel unmounts.
Last updated: 8 September 2026