migrate Block.create to specify children

This commit is contained in:
Shawn Erquhart 2017-09-28 14:02:46 -04:00
parent dc741521ed
commit cd0254407e

View File

@ -16,7 +16,8 @@ import styles from './index.css';
export default class Editor extends Component {
constructor(props) {
super(props);
const emptyBlock = Block.create({ kind: 'block', type: 'paragraph'});
const emptyText = Text.createFromString('');
const emptyBlock = Block.create({ kind: 'block', type: 'paragraph', nodes: [ emptyText ] });
const emptyRawDoc = { nodes: [emptyBlock] };
const rawDoc = this.props.value && markdownToSlate(this.props.value);
const rawDocHasNodes = !isEmpty(get(rawDoc, 'nodes'))