diff --git a/src/ckeditor.tsx b/src/ckeditor.tsx index 9c525609..456e1fe0 100644 --- a/src/ckeditor.tsx +++ b/src/ckeditor.tsx @@ -301,10 +301,10 @@ export default class CKEditor extends React.Component, config: EditorConfig ): Promise { - const { context } = this.props; + const { contextItemMetadata } = this.props; - if ( context ) { - config = withCKEditorReactContextMetadata( context, config ); + if ( contextItemMetadata ) { + config = withCKEditorReactContextMetadata( contextItemMetadata, config ); } return this.props.editor.create( element as HTMLElement, config ) @@ -452,7 +452,7 @@ export interface Props extends InferProps( } const metadata = tryExtractCKEditorReactContextMetadata( editor.config ); - const nameOrId = metadata?.editorName ?? editor.id; + const nameOrId = metadata?.name ?? editor.id; map[ nameOrId ] = { instance: editor, diff --git a/tests/context/ckeditorcontext.test.tsx b/tests/context/ckeditorcontext.test.tsx index d7b21941..69403465 100644 --- a/tests/context/ckeditorcontext.test.tsx +++ b/tests/context/ckeditorcontext.test.tsx @@ -435,7 +435,7 @@ describe( ' Component', () => { > ); @@ -462,11 +462,11 @@ describe( ' Component', () => { > ); @@ -493,8 +493,8 @@ describe( ' Component', () => { > @@ -508,7 +508,7 @@ describe( ' Component', () => { const editorId = 'editor1'; expect( editors[ editorId ].metadata ).to.deep.equal( { - editorName: 'editor1', + name: 'editor1', stuff: 2 } ); } ); @@ -527,7 +527,9 @@ describe( ' Component', () => { > );