Skip to content

Commit

Permalink
Make styles array stable
Browse files Browse the repository at this point in the history
  • Loading branch information
stokesman committed Dec 11, 2024
1 parent 8e07f04 commit c354415
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions platform-docs/docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ import blockEditorContentStyles from "@wordpress/block-editor/build-style/conten
import blocksStyles from "@wordpress/block-library/build-style/style.css?raw";
import blocksEditorStyles from "@wordpress/block-library/build-style/editor.css?raw";

const contentStyles = [
{ css: componentsStyles },
{ css: blockEditorContentStyles },
{ css: blocksStyles },
{ css: blocksEditorStyles },
];

export default function Editor() {
const [ blocks, setBlocks ] = useState( [] );
return (
Expand All @@ -81,15 +88,7 @@ export default function Editor() {
The BlockCanvas component renders the block list within an iframe
and wires up all the necessary events to make the block editor work.
*/ }
<BlockCanvas
height="500px"
styles={ [
{ css: componentsStyles },
{ css: blockEditorContentStyles },
{ css: blocksStyles },
{ css: blocksEditorStyles },
] }
/>
<BlockCanvas height="500px" styles={ contentStyles } />
</BlockEditorProvider>
);
}
Expand Down

0 comments on commit c354415

Please sign in to comment.