Using shared state how to send com.vaadin.ui.Component to client

If modifying the state e.g. with getState().setText(text), it is no longer necessary to explicitly call markAsDirty() - the framework now takes care of this.

If the component to communicate is a sub-component of your component, use the HasComponents/Abstract(Single)ComponentContainer… mechanisms and, if possible, a hierarchy change event to manage it.

If your component refers to a component that is not its subcomponent but elsewhere in hierarchy, just communicate it in state. If the component is a subcomponent but you just want to refer to it (e.g. “focus this subcomponent” based on information on server), you can refer to it in the state in addition to having it in the hierarchy.

The tutorials and examples will probably help clarify how this is used in practice.