1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-29 09:59:48 +02:00

fix some doc's bug (with v0.57.1) (#3393)

* fix: code blocks's info string
this info string. should be `jsx`

* fix: editor's exec invoke
now, editor.exec() is not available in Slate v0.57.1
so, use editor.insertText() to instead it

*  refactor: delete a nerver used value

* update add new chinese translate
      update chinese translate to `v0.57.1`

Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com>
This commit is contained in:
Xleine
2020-01-28 04:24:15 +08:00
committed by Ian Storm Taylor
parent 8202e08102
commit 217bdd611b
7 changed files with 28 additions and 38 deletions

View File

@@ -16,10 +16,10 @@ _Note, if you'd rather use a pre-bundled version of Slate, you can `yarn add sla
Once you've installed Slate, you'll need to import it.
```js
```jsx
// Import React dependencies.
import React, { useEffect, useMemo, useState } from "react";
// Import the Slate editor factory.
import { createEditor } from 'slate'
@@ -102,7 +102,7 @@ There's only one last step. So far we've been using an empty `[]` array as the i
The value is just plain JSON. Here's one containing a single paragraph block with some text in it:
```js
```jsx
const App = () => {
const editor = useMemo(() => withReact(createEditor()), [])
// Add the initial value when setting up our state.