Skip to main content
Version: 4.3

selectCellType()

function selectCellType(cell): "link" | "element";

Selects a cell's type discriminator — 'element' for React elements or 'link' for React links. Handy for branching on the kind of cell.

Parameters

ParameterTypeDescription
cellComputed<CellRecord>the resolved cell record

Returns

"link" | "element"

Example

import { useCell, selectCellType } from '@joint/react';

const type = useCell(cellId, selectCellType);

Stay in the know

Be where thousands of diagramming enthusiasts meet

Star us on GitHub