wTextEditor: PropTypes.func.isRequired, type: PropTypes.string.isRequired, value: PropTypes.string.isRequired, }; } constructor(props) { super(props); this.state = { value: this.props.value, }; this.valuePreRef = createRef(); } componentDidMount() { editableItem( { element: this.valuePreRef.current, trigger: "dblclick", }, element => { this.props.showTextEditor(element); } ); } render() { const { value } = this.state; const isComment = this.props.type === "comment"; const isWhiteSpace = !/[^\s]/.exec(value); return createElement( Fragment, null, isComment ? dom.span({}, "") : null ); } } module.exports = TextNode; PK