import React from 'react'; import PropTypes from 'prop-types'; import { Subscribe } from 'unstated'; import RevisionBody from '../Page/RevisionBody'; import EditorOptionsContainer from '../../services/EditorOptionsContainer'; /** * Wrapper component for Page/RevisionBody */ export default class Preview extends React.Component { render() { return ( { editorOptionsContainer => ( // eslint-disable-next-line arrow-body-style
{ this.previewElement = elm; this.props.inputRef(elm); }} onScroll={(event) => { if (this.props.onScroll != null) { this.props.onScroll(event.target.scrollTop); } }} >
)}
); } } Preview.propTypes = { html: PropTypes.string, inputRef: PropTypes.func.isRequired, // for getting div element isMathJaxEnabled: PropTypes.bool, renderMathJaxOnInit: PropTypes.bool, onScroll: PropTypes.func, };