Skip to content

Instantly share code, notes, and snippets.

@aduth
Last active February 26, 2018 14:57
Show Gist options
  • Save aduth/11897283d9abf89aa1e7f6e32c8cc09c to your computer and use it in GitHub Desktop.
Save aduth/11897283d9abf89aa1e7f6e32c8cc09c to your computer and use it in GitHub Desktop.
Select - Omit Props Purely
diff --git a/editor/components/inserter/index.js b/editor/components/inserter/index.js
index 82372dd82..54de2ac6b 100644
--- a/editor/components/inserter/index.js
+++ b/editor/components/inserter/index.js
@@ -88,7 +88,7 @@ export default compose( [
withSelect( ( select ) => ( {
insertionPoint: select( 'core/editor' ).getBlockInsertionPoint,
selectedBlock: select( 'core/editor' ).getSelectedBlock,
- } ) ),
+ } ), { pure: false } ),
withDispatch( ( dispatch, ownProps ) => ( {
showInsertionPoint: dispatch( 'core/editor' ).showInsertionPoint,
hideInsertionPoint: dispatch( 'core/editor' ).hideInsertionPoint,
@@ -103,6 +103,8 @@ export default compose( [
return dispatch( 'core/editor' ).insertBlock( insertedBlock, index, rootUID );
},
} ) ),
+ omitProps( 'selectedBlock' ),
+ pure,
withContext( 'editor' )( ( settings ) => {
const { blockTypes, templateLock } = settings;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment