Home > @activeviam/activeui-sdk > SelectedRootDockAware
SelectedRootDockAware() function
A Function As Child Component that provides the API of the root dock holding the widget that is currently selected to child components. See SelectedWidgetAware() for more details.
Signature:
export declare function SelectedRootDockAware(props: SelectedRootDockAwareProps): JSX.Element;
Parameters
Parameter | Type | Description |
---|---|---|
props | SelectedRootDockAwareProps |
Returns:
JSX.Element
Example
// Custom button for undoing the last change on a dashboard.
const UndoButton = () => (
<SelectedRootDockAware>
{selectedRootDockApi => (
<Button
disabled={!selectedRootDockApi.hasPreviousState()}
onClick={() => {
selectedRootDockApi.undo();
}}
>
Undo
</Button>
)}
</SelectedRootDockAware>
);