Skip to content

API > @blocksuite/blocks > getNextBlock

Function: getNextBlock ​

getNextBlock(model, map = {}): BaseBlockModel | null

Parameters ​

ParameterType
modelBaseBlockModel< object >
mapRecord< string, true >

Returns ​

BaseBlockModel | null

Example ​

md
page
- note
 - paragraph <- when invoked here, the traverse order will be following
   - child <- 1
 - sibling <- 2
- note <- 3 (will be skipped)
  - paragraph <- 4
page
- note
 - paragraph <- when invoked here, the traverse order will be following
   - child <- 1
 - sibling <- 2
- note <- 3 (will be skipped)
  - paragraph <- 4

NOTE: this method will skip the affine:note block

Defined In ​

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