You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just followed the steps to bootstrap a basic editor and copied your code in my react project
import { createRoot } from "react-dom/client";
import { BlockEditorProvider, BlockCanvas } from "@wordpress/block-editor";
import { registerCoreBlocks } from "@wordpress/block-library";
// Default styles that are needed for the editor.
import "@wordpress/components/build-style/style.css";
import "@wordpress/block-editor/build-style/style.css";
// Default styles that are needed for the core blocks.
import "@wordpress/block-library/build-style/common.css";
import "@wordpress/block-library/build-style/style.css";
import "@wordpress/block-library/build-style/editor.css";
// Register the default core block types.
registerCoreBlocks();
function Editor() {
const [blocks, setBlocks] = useState([]);
return (
/*
The BlockEditorProvider is the wrapper of the block editor's state.
All the UI elements of the block editor need to be rendered within this provider.
*/
<BlockEditorProvider
value={blocks}
onChange={setBlocks}
onInput={setBlocks}
>
{/*
The BlockCanvas component renders the block list within an iframe
and wire up all the necessary events to make the block editor work.
*/}
<BlockCanvas height="500px" />
</BlockEditorProvider>
);
}
createRoot(document.getElementById("root")!).render(<Editor />);
But the editor styles are off, it is missing a lot of styles and looks ugly, also, I tried using text align on paragraph and it does not work so I believe a css is not getting loaded, I tried to debug, the css file is being imported and the file has classes for alignment but when I inspect the pargraph element, I cannot see the classes in styles tab
Step-by-step reproduction instructions
create a new react project and siply paste the example in docs.
Screenshots, screen recording, code snippet
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
Please confirm which theme type you used for testing.
Block
Classic
Hybrid (e.g. classic with theme.json)
Not sure
The text was updated successfully, but these errors were encountered:
Description
I just followed the steps to bootstrap a basic editor and copied your code in my react project
But the editor styles are off, it is missing a lot of styles and looks ugly, also, I tried using text align on paragraph and it does not work so I believe a css is not getting loaded, I tried to debug, the css file is being imported and the file has classes for alignment but when I inspect the pargraph element, I cannot see the classes in styles tab
Step-by-step reproduction instructions
create a new react project and siply paste the example in docs.
Screenshots, screen recording, code snippet
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
The text was updated successfully, but these errors were encountered: