Last active
February 26, 2018 14:57
-
-
Save aduth/11897283d9abf89aa1e7f6e32c8cc09c to your computer and use it in GitHub Desktop.
Select - Omit Props Purely
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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