Skip to content

Commit

Permalink
Cache CopyContentButton element for EditorActions filter
Browse files Browse the repository at this point in the history
  • Loading branch information
mcsf committed Jan 17, 2018
1 parent c87ada1 commit f12cfd6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions editor/hooks/copy-content/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ const Enhanced = compose(
withState( { hasCopied: false } )
)( CopyContentButton );

const cached = <Enhanced key="copy-content-button" />;

addFilter(
'editor.EditorActions.children',
'core/copy-content/button',
( children ) =>
[ ...children, <Enhanced key="copy-content-button" /> ]
( children ) => [ ...children, cached ]
);

0 comments on commit f12cfd6

Please sign in to comment.