API > @blocksuite/blocks > asyncGetBlockElementByModel
Function: asyncGetBlockElementByModel ​
asyncGetBlockElementByModel(
model
):Promise
<BlockComponentElement
|null
>
Get block element by its model and wait for the page element to finish updating. Note that this function is used for compatibility only, and may be removed in the future.
Use root.view.viewFromPath
instead.
Parameters ​
Parameter | Type |
---|---|
model | BaseBlockModel < object > |
Returns ​
Promise
< BlockComponentElement
| null
>
Deprecated ​
Defined In ​
packages/blocks/src/_common/utils/query.ts:269