Skip to content

Commit ef431a8

Browse files
committed
feat: added placeholder example
1 parent 8c6eaf0 commit ef431a8

File tree

1 file changed

+6
-3
lines changed
  • examples/01-basic/11-placeholder

1 file changed

+6
-3
lines changed

examples/01-basic/11-placeholder/App.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@ import { useCreateBlockNote } from "@blocknote/react";
55
import { locales } from "@blocknote/core";
66

77
export default function App() {
8+
// Set the user locale.
9+
const userLocale = "en";
10+
811
const placeholder = "This is a custom placeholder";
912

1013
// Creates a new editor instance.
1114
const editor = useCreateBlockNote({
1215
dictionary: {
13-
...locales.en,
16+
...locales[userLocale],
1417
placeholders: {
15-
...locales.en.placeholders,
16-
default: placeholder ?? locales.en.placeholders.default,
18+
...locales[userLocale].placeholders,
19+
default: placeholder ?? locales[userLocale].placeholders.default,
1720
},
1821
},
1922
});

0 commit comments

Comments
 (0)