Skip to main content

MosaicRootActions

react-mosaic-component


react-mosaic-component / MosaicRootActions

Interface: MosaicRootActions<T>

Defined in: libs/react-mosaic-component/src/lib/contextTypes.ts:36

These actions are used to alter the state of the view tree

Type Parameters

T

T extends MosaicKey

Properties

createNode?

optional createNode?: CreateNode<T>

Defined in: libs/react-mosaic-component/src/lib/contextTypes.ts:63


expand

expand: (path, percentage?) => void

Defined in: libs/react-mosaic-component/src/lib/contextTypes.ts:42

Increases the size of this node and bubbles up the tree

Parameters

path

MosaicPath

Path to node to expand

percentage?

number

Every node in the path up to root will be expanded to this percentage

Returns

void


getRoot

getRoot: () => MosaicNode<T> | null

Defined in: libs/react-mosaic-component/src/lib/contextTypes.ts:87

Returns the root of this Mosaic instance

Returns

MosaicNode<T> | null


hide

hide: (path, suppressOnChange?) => void

Defined in: libs/react-mosaic-component/src/lib/contextTypes.ts:53

Hide the node at path but keep it in the DOM. Used in Drag and Drop

Parameters

path

MosaicPath

suppressOnChange?

boolean

(default: false) - if true, won't trigger onChange event

Returns

void


remove

remove: (path) => void

Defined in: libs/react-mosaic-component/src/lib/contextTypes.ts:47

Remove the node at path

Parameters

path

MosaicPath

Returns

void


replaceWith

replaceWith: (path, node) => void

Defined in: libs/react-mosaic-component/src/lib/contextTypes.ts:70

Replace currentNode at path with node

Parameters

path

MosaicPath

node

MosaicNode<T>

Returns

void


show

show: (path, suppressOnChange?) => void

Defined in: libs/react-mosaic-component/src/lib/contextTypes.ts:61

Show a previously hidden node. This is used to restore a component if a drag operation is cancelled.

Parameters

path

MosaicPath

suppressOnChange?

boolean

(default: false) - if true, won't trigger onChange event

Returns

void


updateTree

updateTree: (updates, modifiers?) => void

Defined in: libs/react-mosaic-component/src/lib/contextTypes.ts:76

Atomically applies all updates to the current tree

Parameters

updates

MosaicUpdate<T>[]

modifiers?
shouldNormalize?

boolean

suppressOnChange?

boolean

suppressOnRelease?

boolean

Returns

void