CommentEditorLazyRenderer.jsx 785 B

12345678910111213141516171819202122232425262728293031
  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import { withUnstatedContainers } from '../UnstatedUtils';
  4. import AppContainer from '../../services/AppContainer';
  5. import CommentEditor from './CommentEditor';
  6. const CommentEditorLazyRenderer = (props) => {
  7. const growiRenderer = props.appContainer.getRenderer('comment');
  8. return (
  9. <CommentEditor
  10. growiRenderer={growiRenderer}
  11. replyTo={undefined}
  12. isForNewComment
  13. />
  14. );
  15. };
  16. /**
  17. * Wrapper component for using unstated
  18. */
  19. const CommentEditorLazyRendererWrapper = withUnstatedContainers(CommentEditorLazyRenderer, [AppContainer]);
  20. CommentEditorLazyRenderer.propTypes = {
  21. appContainer: PropTypes.instanceOf(AppContainer).isRequired,
  22. };
  23. export default CommentEditorLazyRendererWrapper;