Skip to content

Commit

Permalink
Update InnerBlocks defaultblock doc usage (#56728)
Browse files Browse the repository at this point in the history
Co-authored-by: Riad Benguella <benguella@gmail.com>
  • Loading branch information
colorful-tones and youknowriad committed Dec 7, 2023
1 parent 9d13cf0 commit 0fa652a
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions packages/block-editor/src/components/inner-blocks/README.md
Expand Up @@ -188,8 +188,19 @@ For example, a button block, deeply nested in several levels of block `X` that u

### `defaultBlock`

- **Type:** `Array`
- **Default:** - `undefined`. Determines which block type should be inserted by default and any attributes that should be set by default when the block is inserted. Takes an array in the form of `[ blockname, {blockAttributes} ]`.
- **Type:** `Object`
- **Default:** - `undefined`

Determines which block type should be inserted by default and any attributes that should be set by default when the block is inserted. Takes an object in the form of `{ name: blockname, attributes: {blockAttributes} }`.

```jsx
const DEFAULT_BLOCK = { name: 'core/paragraph', attributes: { content: 'Lorem ipsum...' } };
...
<InnerBlocks
defaultBlock={ DEFAULT_BLOCK }
directInsert={ true }
/>
```

### `directInsert`

Expand Down

1 comment on commit 0fa652a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 0fa652a.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7132135022
📝 Reported issues:

Please sign in to comment.