mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-21 22:45:18 +02:00
Docs improvements suggestions (#801)
* Fix typo * Make it clearer that addMark has changed too
This commit is contained in:
committed by
Ian Storm Taylor
parent
da1210da0f
commit
06c54bd991
@@ -7,7 +7,7 @@
|
||||
|
||||
Okay, so you've got Slate installed and rendered on the page, and when you type in it, you can see the changes reflected. But you want to do more than just type a plaintext string.
|
||||
|
||||
What makes Slate great is how easy it is to customize. Just like other React components you're used it, Slate allows you to pass in handlers that are triggered on certain events. You've already seen on the `onChange` handler can be used to store the changed editor state, but let's try add something more...
|
||||
What makes Slate great is how easy it is to customize. Just like other React components you're used to, Slate allows you to pass in handlers that are triggered on certain events. You've already seen on the `onChange` handler can be used to store the changed editor state, but let's try add something more...
|
||||
|
||||
We'll show you how to use the `onKeyDown` handler to change the editor's content when the user presses a button.
|
||||
|
||||
|
@@ -123,7 +123,9 @@ function BoldMark(props) {
|
||||
|
||||
Pretty simple, right?
|
||||
|
||||
And now, let's tell Slate about that mark. To do that, we'll add it to the `schema` object under a `marks` property, like so:
|
||||
And now, let's tell Slate about that mark.
|
||||
To do that, we'll add it to the `schema` object under a `marks` property.
|
||||
Also, let's allow our mark to be toggled by changing `addMark` to `toggleMark`.
|
||||
|
||||
```js
|
||||
function BoldMark(props) {
|
||||
|
Reference in New Issue
Block a user