Skip to content

Commit

Permalink
Block Library: Avoid using component naming conventions for non-compo…
Browse files Browse the repository at this point in the history
…nent code (#61793)


Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: ajitbohra <ajitbohra@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
  • Loading branch information
4 people authored May 20, 2024
1 parent c464a35 commit 91918ed
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
5 changes: 2 additions & 3 deletions packages/block-library/src/form-submit-button/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
*/
import { useBlockProps, InnerBlocks } from '@wordpress/block-editor';

const Save = () => {
export default function save() {
const blockProps = useBlockProps.save();
return (
<div className="wp-block-form-submit-wrapper" { ...blockProps }>
<InnerBlocks.Content />
</div>
);
};
export default Save;
}
5 changes: 2 additions & 3 deletions packages/block-library/src/form/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { InnerBlocks, useBlockProps } from '@wordpress/block-editor';

const Save = ( { attributes } ) => {
export default function save( { attributes } ) {
const blockProps = useBlockProps.save();
const { submissionMethod } = attributes;

Expand All @@ -16,5 +16,4 @@ const Save = ( { attributes } ) => {
<InnerBlocks.Content />
</form>
);
};
export default Save;
}
2 changes: 1 addition & 1 deletion packages/block-library/src/query-no-results/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
*/
import { InnerBlocks } from '@wordpress/block-editor';

export default function QueryNoResultsSave() {
export default function save() {
return <InnerBlocks.Content />;
}
2 changes: 1 addition & 1 deletion packages/block-library/src/query/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { useInnerBlocksProps, useBlockProps } from '@wordpress/block-editor';

export default function QuerySave( { attributes: { tagName: Tag = 'div' } } ) {
export default function save( { attributes: { tagName: Tag = 'div' } } ) {
const blockProps = useBlockProps.save();
const innerBlocksProps = useInnerBlocksProps.save( blockProps );
return <Tag { ...innerBlocksProps } />;
Expand Down

0 comments on commit 91918ed

Please sign in to comment.