Download slate/site/examples/js/plaintext.jsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 614 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/slate/site/examples/js/plaintext.jsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/slate/site/examples/js/plaintext.jsx
-
curl -L -o plaintext.jsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/slate/site/examples/js/plaintext.jsx
614 Bytes
| import React, { useMemo } from 'react' | |
| import { createEditor } from 'slate' | |
| import { Slate, Editable, withReact } from 'slate-react' | |
| import { withHistory } from 'slate-history' | |
| const PlainTextExample = () => { | |
| const editor = useMemo(() => withHistory(withReact(createEditor())), []) | |
| return ( | |
| <Slate editor={editor} initialValue={initialValue}> | |
| <Editable placeholder="Enter some plain text..." /> | |
| </Slate> | |
| ) | |
| } | |
| const initialValue = [ | |
| { | |
| type: 'paragraph', | |
| children: [ | |
| { text: 'This is editable plain text, just like a <textarea>!' }, | |
| ], | |
| }, | |
| ] | |
| export default PlainTextExample | |