gutenberg-examples icon indicating copy to clipboard operation
gutenberg-examples copied to clipboard

values for source

Open gayratv opened this issue 4 years ago • 1 comments

Documentation describe values for source key of attributes object: https://developer.wordpress.org/block-editor/developers/block-api/block-attributes/

But source: 'children' is not described.

Where I can read about 'children' value ?

gayratv avatar Mar 18 '20 14:03 gayratv

children is a ReactJS prop that every component receives. It contains any values "inside" that component.

e.g. If you are using JSX that looks something like

<MyComponent>
  <h2>My Title</h2>
  <p>My paragraph</p>
</MyComponent>

MyComponent will receive a children prop that contains the h2 and p tags with their content.

Further Reading

salcode avatar Mar 28 '22 19:03 salcode