mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-20 22:21:20 +02:00
Docs fixes for 0.50.0 (#3133)
* docs: typos * docs: markdown inline code formatting https://meta.stackexchange.com/questions/82718/how-do-i-escape-a-backtick-within-in-line-code-in-markdown * docs: remove unused value, move comment, add deps to callback * docs: add deps to renderMark callback
This commit is contained in:
committed by
Ian Storm Taylor
parent
4140066c0b
commit
d457bc52b9
@@ -8,7 +8,6 @@ So we start with our app from earlier:
|
||||
|
||||
```js
|
||||
const App = () => {
|
||||
const [value, setValue] = useState(initialValue)
|
||||
const editor = useMemo(() => withReact(createEditor()), [])
|
||||
const renderElement = useCallback(props => {
|
||||
switch (props.element.type) {
|
||||
@@ -67,8 +66,8 @@ const App = () => {
|
||||
return
|
||||
}
|
||||
|
||||
// When "`" is pressed, keep our existing code block logic.
|
||||
switch (event.key) {
|
||||
// When "`" is pressed, keep our existing code block logic.
|
||||
case '`': {
|
||||
event.preventDefault()
|
||||
const { selection } = editor
|
||||
@@ -132,7 +131,7 @@ const App = () => {
|
||||
return <BoldMark {...props} />
|
||||
}
|
||||
}
|
||||
})
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<Slate editor={editor} defaultValue={defaultValue}>
|
||||
|
Reference in New Issue
Block a user