1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-19 13:41:19 +02:00

Update Adding Event Handlers walkthrough (#3169)

The previous example no longer uses `onChange`, so don't reference it in this walkthrough.
This commit is contained in:
sherwinyu
2019-11-29 14:25:40 -08:00
committed by Ian Storm Taylor
parent 2ad7735869
commit 0da1dd128c

View File

@@ -2,7 +2,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 to, Slate allows you to pass in handlers that are triggered on certain events. You've already seen how the `onChange` handler can be used to store the changed editor value, but let's try adding 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.
Let's use the `onKeyDown` handler to change the editor's content when we press a key.