1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-07-31 04:20:26 +02:00

Improve and refactor examples (#1930)

This just refactors the examples to make the styled defined inline with each example, to make it easier to follow for folks. And in the process fixes a few issues that people brought up.

Fixes https://github.com/ianstormtaylor/slate/issues/1920
Fixes https://github.com/ianstormtaylor/slate/issues/1925
This commit is contained in:
Ian Storm Taylor
2018-07-01 15:13:29 -06:00
committed by GitHub
parent 1923888af1
commit 257b28aa84
28 changed files with 1459 additions and 1468 deletions

View File

@@ -22,6 +22,22 @@ class PlainText extends React.Component {
),
}
/**
* Render the editor.
*
* @return {Component} component
*/
render() {
return (
<Editor
placeholder="Enter some plain text..."
value={this.state.value}
onChange={this.onChange}
/>
)
}
/**
* On change.
*
@@ -31,24 +47,6 @@ class PlainText extends React.Component {
onChange = ({ value }) => {
this.setState({ value })
}
/**
* Render the editor.
*
* @return {Component} component
*/
render() {
return (
<div className="editor">
<Editor
placeholder="Enter some plain text..."
value={this.state.value}
onChange={this.onChange}
/>
</div>
)
}
}
/**