How to use the @wordpress/data.query function in @wordpress/data

To help you get started, we’ve selected a few @wordpress/data examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github WordPress / gutenberg / editor / hooks / copy-content / index.js View on Github external
return (
		 setState( { hasCopied: true } ) }
			onFinishCopy={ () => setState( { hasCopied: false } ) }
		>
			{ hasCopied ?
				__( 'Copied!' ) :
				__( 'Copy All Content' ) }
		
	);
}

const Enhanced = compose(
	query( ( select ) => ( {
		editedPostContent: select( 'core/editor', 'getEditedPostContent' ),
	} ) ),
	withState( { hasCopied: false } )
)( CopyContentButton );

const buttonElement = ;

addFilter(
	'editor.EditorActions.tools',
	'core/copy-content/button',
	( children ) => [ ...children, buttonElement ]
);