From 1a7e673699f0256bd209ba82ca15d25d26693bc4 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 7 May 2019 21:42:56 -0400 Subject: [PATCH] fix: markdown preview now shows --- .../common/form-components/form-field.jsx | 41 +++++++++---------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/src/ui/component/common/form-components/form-field.jsx b/src/ui/component/common/form-components/form-field.jsx index 3dbfcb916..610e83b57 100644 --- a/src/ui/component/common/form-components/form-field.jsx +++ b/src/ui/component/common/form-components/form-field.jsx @@ -1,16 +1,14 @@ // @flow import type { ElementRef } from 'react'; -import React, { Suspense } from 'react'; +import React from 'react'; import ReactDOMServer from 'react-dom/server'; -import MarkdownPreview from 'component/common/markdown-preview'; import 'easymde/dist/easymde.min.css'; import Toggle from 'react-toggle'; import { openEditorMenu, stopContextMenu } from 'util/context-menu'; - -const SimpleMDE = React.lazy(() => - import(/* webpackChunkName: "SimpleMDE" */ - 'react-simplemde-editor') -); +import SimpleMDE from 'react-simplemde-editor'; +// It would be nice to use the lazy markdown preview component but react-dom/server +// doesn't support it yet. We use that for renderToString on our markdown text +import MarkdownPreview from 'component/common/markdown-preview-internal'; type Props = { name: string, @@ -137,21 +135,20 @@ export class FormField extends React.PureComponent {
- }> - ; - return ReactDOMServer.renderToString(preview); - }, - }} - /> - + ; + return ReactDOMServer.renderToString(preview); + }, + }} + />
);