MarkupApi
Markup utilities returned by useMarkup.
Properties​
magnetRef​
readonly magnetRef: (selector, options?) => (node) => void;
Returns a React ref callback that registers the node under the given selector name AND marks it as a JointJS magnet, a valid endpoint for link connections.
Parameters​
| Parameter | Type | Description |
|---|---|---|
selector | string | Unique selector name within the element (e.g. 'port-in', 'row-0'). |
options? | MagnetRefOptions | Magnet behavior options. |
Returns​
(node) => void
Throws​
If selector is one of the reserved names (__portal__, root, portRoot).
selectorRef​
readonly selectorRef: (selector) => (node) => void;
Returns a React ref callback that registers the node under the given selector name so links and tools can target it by name.
Parameters​
| Parameter | Type | Description |
|---|---|---|
selector | string | Unique selector name within the element (e.g. 'body', 'item-0'). |
Returns​
(node) => void
Throws​
If selector is one of the reserved names (__portal__, root, portRoot).