mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-11 17:53:59 +02:00
cleanup plain text example
This commit is contained in:
@@ -3,7 +3,6 @@ import { Editor, Plain } from '../..'
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import initialState from './state.json'
|
import initialState from './state.json'
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The plain text example.
|
* The plain text example.
|
||||||
*
|
*
|
||||||
@@ -22,6 +21,16 @@ class PlainText extends React.Component {
|
|||||||
state: Plain.deserialize(initialState)
|
state: Plain.deserialize(initialState)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On change.
|
||||||
|
*
|
||||||
|
* @param {State} state
|
||||||
|
*/
|
||||||
|
|
||||||
|
onChange = (state) => {
|
||||||
|
this.setState({ state })
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Render the editor.
|
* Render the editor.
|
||||||
*
|
*
|
||||||
@@ -38,17 +47,6 @@ class PlainText extends React.Component {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* On change.
|
|
||||||
*
|
|
||||||
* @param {State} state
|
|
||||||
*/
|
|
||||||
|
|
||||||
onChange = (state) => {
|
|
||||||
console.log('Content:', Plain.serialize(state))
|
|
||||||
this.setState({ state })
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user