React playground

Nova v3.37.0

Preview

React

Two-way binding

The application owns the selected value. Edit the field, then use Set Berlin to update it from application code.

Controlled

Pass the value into the component and update state from event.detail in onValueChanged.

The state type comes from an imported helper included when this example opens in the editor.

tsexport interface Selection {
  value: string;
}
export const initialSelection: Selection = { value: 'Paris' };