Skip to content

API > @blocksuite/blocks > getBlockElementByModel

Function: getBlockElementByModel ​

getBlockElementByModel(model): null | BlockElement< BaseBlockModel< object >, BlockService< BaseBlockModel< object > >, string >

Get block element by model. Note that this function is used for compatibility only, and may be removed in the future.

Use root.view.viewFromPath instead.

Parameters ​

ParameterType
modelBaseBlockModel< object >

Returns ​

null | BlockElement< BaseBlockModel< object >, BlockService< BaseBlockModel< object > >, string >

Deprecated ​

Defined In ​

packages/blocks/src/_common/utils/query.ts:252