Skip to content

Commit

Permalink
RegistryProvider is absorbed by BlockEditorProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Aug 23, 2019
1 parent 05e01c9 commit f630096
Showing 1 changed file with 11 additions and 20 deletions.
31 changes: 11 additions & 20 deletions packages/block-library/src/block/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,12 @@ import { Placeholder, Spinner, Disabled } from '@wordpress/components';
import {
withSelect,
withDispatch,
withRegistry,
RegistryProvider,
createRegistry,
} from '@wordpress/data';
import { __ } from '@wordpress/i18n';
import {
BlockEditorProvider,
BlockList,
WritingFlow,
storeConfig,
} from '@wordpress/block-editor';
import { compose } from '@wordpress/compose';
import { parse, serialize } from '@wordpress/blocks';
Expand All @@ -32,7 +28,7 @@ import ReusableBlockEditPanel from './edit-panel';
import ReusableBlockIndicator from './indicator';

class ReusableBlockEdit extends Component {
constructor( { reusableBlock, registry } ) {
constructor( { reusableBlock } ) {
super( ...arguments );

this.startEditing = this.startEditing.bind( this );
Expand All @@ -56,8 +52,6 @@ class ReusableBlockEdit extends Component {
blocks: [],
};
}

this.registry = createRegistry( { 'core/block-editor': storeConfig }, registry );
}

componentDidMount() {
Expand Down Expand Up @@ -123,18 +117,16 @@ class ReusableBlockEdit extends Component {
}

let element = (
<RegistryProvider value={ this.registry }>
<BlockEditorProvider
settings={ settings }
value={ blocks }
onChange={ this.setBlocks }
onInput={ this.setBlocks }
>
<WritingFlow>
<BlockList />
</WritingFlow>
</BlockEditorProvider>
</RegistryProvider>
<BlockEditorProvider
settings={ settings }
value={ blocks }
onChange={ this.setBlocks }
onInput={ this.setBlocks }
>
<WritingFlow>
<BlockList />
</WritingFlow>
</BlockEditorProvider>
);

if ( ! isEditing ) {
Expand Down Expand Up @@ -200,5 +192,4 @@ export default compose( [
onSave: partial( saveReusableBlock, ref ),
};
} ),
withRegistry,
] )( ReusableBlockEdit );

0 comments on commit f630096

Please sign in to comment.