1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-30 10:29:48 +02:00
This commit is contained in:
Sunny Hirai
2021-04-01 18:13:48 -07:00
45 changed files with 733 additions and 911 deletions

View File

@@ -2,17 +2,17 @@
Slate is a monorepo divided up into multiple npm packages, so to install it you do:
```
```text
yarn add slate slate-react
```
You'll also need to be sure to install Slate's peer dependencies:
```
```text
yarn add react react-dom
```
_Note, if you'd rather use a pre-bundled version of Slate, you can `yarn add slate` and retrieve the bundled `dist/slate.js` file! Check out the [Using the Bundled Source](./XX-using-the-bundled-source.md) guide for more information._
_Note, if you'd rather use a pre-bundled version of Slate, you can `yarn add slate` and retrieve the bundled `dist/slate.js` file! Check out the_ [_Using the Bundled Source_](xx-using-the-bundled-source.md) _guide for more information._
Once you've installed Slate, you'll need to import it.
@@ -47,9 +47,9 @@ const App = () => {
Of course we haven't rendered anything, so you won't see any changes.
> If you are using TypeScript, you will also need to extend the `Editor` with `ReactEditor` as per the documentation on [TypeScript](/concepts/11-typescript). The example below also includes the custom types required for the rest of this example.
> If you are using TypeScript, you will also need to extend the `Editor` with `ReactEditor` as per the documentation on [TypeScript](https://github.com/ianstormtaylor/slate/tree/4b92b752ef234dae57149c713a260b7bacb3f810/concepts/11-typescript/README.md). The example below also includes the custom types required for the rest of this example.
```ts
```typescript
// TypeScript Users only add this code
import { BaseEditor } from 'slate'
import { ReactEditor } from 'slate-react'