Skip to content

Commit

Permalink
Merge pull request #28 from ryanwelcher/fix/transforms
Browse files Browse the repository at this point in the history
Add better syntax to the retrieve the content in the next steps example.
  • Loading branch information
ryanwelcher authored Apr 30, 2024
2 parents e47f5ee + 08c8565 commit 1f4f357
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions templates/transforms/files/plugin/README.md.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,9 @@ const transformers = {
blocks: [ 'core/cover' ],
transform: ( attributes, innerBlocks ) => {
const [ firstBlock ] = innerBlocks;
const { content } =
firstBlock.attributes || 'More that meets the eye!';
const content =
firstBlock?.attributes?.content ||
'More that meets the eye!';
return createBlock( 'block-developers-cookbook/transforms', {
message: content,
} );
Expand Down

0 comments on commit 1f4f357

Please sign in to comment.