Skip to content

Commit bf6facd

Browse files
committed
Added passing the className from parent in renderer and editor components.
1 parent c9a110d commit bf6facd

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

packages/plate/components/editor/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export function PlateEditor(props: {
2222
blocksApi?: any;
2323
intl?: any;
2424
children?: ReactNode;
25+
className?: string;
2526
onChange: (options: {
2627
editor: TPlateEditor<Value, AnyPluginConfig>;
2728
value: TElement[];
@@ -45,7 +46,11 @@ export function PlateEditor(props: {
4546
{/* Provides editor context */}
4647
<EditorContainer className="">
4748
{/* Styles the editor area */}
48-
<Editor variant="block" placeholder="Type text..." />
49+
<Editor
50+
className={props.className}
51+
variant="block"
52+
placeholder="Type text..."
53+
/>
4954
</EditorContainer>
5055
{props.children}
5156
</Plate>
@@ -84,6 +89,7 @@ export function PlateRenderer(
8489
<EditorView
8590
{...rest}
8691
editor={editor as unknown as SlateEditor}
92+
className={props.className}
8793
variant="none"
8894
/>
8995
</Plate>

0 commit comments

Comments
 (0)