docs: remove placeholder property from exampleTheme (#4802)

This commit is contained in:
Karam Qaoud
2023-07-20 14:17:21 +02:00
committed by GitHub
parent dc996d09a5
commit e0e77b5e9c
2 changed files with 8 additions and 4 deletions

View File

@ -144,7 +144,6 @@ describe('LexicalSelection tests', () => {
},
listitem: 'editor-listitem',
paragraph: 'editor-paragraph',
placeholder: 'editor-placeholder',
quote: 'editor-quote',
text: {
bold: 'editor-text-bold',

View File

@ -10,7 +10,6 @@ Lexical tries to make theming straight-forward, by providing a way of passing a
const exampleTheme = {
ltr: 'ltr',
rtl: 'rtl',
placeholder: 'editor-placeholder',
paragraph: 'editor-paragraph',
};
```
@ -47,14 +46,21 @@ passing it as a property of the `initialConfig` to `<LexicalComposer>`, like sho
```jsx
import {LexicalComposer} from '@lexical/react/LexicalComposer';
import {PlainTextPlugin} from '@lexical/react/LexicalPlainTextPlugin';
import {ContentEditable} from '@lexical/react/LexicalContentEditable';
import {exampleTheme} from './exampleTheme';
import LexicalErrorBoundary from '@lexical/react/LexicalErrorBoundary';
const initialConfig = {namespace: 'MyEditor', theme: exampleTheme};
export default function Editor() {
return (
<LexicalComposer initialConfig={initialConfig}>
<div className="editor-container">...</div>
<PlainTextPlugin
contentEditable={<ContentEditable />}
placeholder={<div className="editor-placeholder">Enter some text...</div>}
ErrorBoundary={LexicalErrorBoundary}
/>
</LexicalComposer>
);
}
@ -77,7 +83,6 @@ Many of the Lexical's core nodes also accept theming properties. Here's a more c
const exampleTheme = {
ltr: 'ltr',
rtl: 'rtl',
placeholder: 'editor-placeholder',
paragraph: 'editor-paragraph',
quote: 'editor-quote',
heading: {