21 lines
446 B
JavaScript
21 lines
446 B
JavaScript
import { useState } from '@wordpress/element';
|
|
import { BlockEditorProvider } from '@wordpress/block-editor';
|
|
|
|
import BlockEditor from './BlockEditor';
|
|
|
|
import './editor.scss';
|
|
|
|
export default function Editor() {
|
|
const [ blocks, updateBlocks ] = useState([]);
|
|
|
|
return (
|
|
<BlockEditorProvider
|
|
value={ blocks }
|
|
onInput={ updateBlocks }
|
|
onChange={ updateBlocks }
|
|
>
|
|
<BlockEditor/>
|
|
</BlockEditorProvider>
|
|
);
|
|
}
|