为什么@uiw/react-md-editor在nextjs 13上不工作

jaxagkaj  于 2023-05-17  发布在  React
关注(0)|答案(1)|浏览(111)

我尝试在NextJS 13上使用@uiw/react-md-editor作为markdown编辑器。但我得到了这个错误

这是我在editor.tsx上的代码

const MDEditor = dynamic<MDEditorProps>(() => import('@uiw/react-md-editor'), {
  ssr: false,
});

export const BlogList = (props: BlogListProps) => {
  const { heading, listContents, data } = props;
  const styles = useStyles();

  return (
    <div>
      <MDEditor value={data} height={700} />
    </div>
  );
};

我有next.config.ts

const { withNx } = require('@nrwl/next/plugins/with-nx');
const removeImports = require('next-remove-imports')();
/**
 * @type {import('@nrwl/next/plugins/with-nx').WithNxOptions}
 **/
const nextConfig = removeImports({
  nx: {
    // Set this to true if you would like to use SVGR
    // See: https://github.com/gregberge/svgr
    svgr: false,
  },
  experimental: {
    appDir: true,
  },
});

module.exports = withNx(nextConfig);

希望你能帮我解决这个问题

shyt4zoc

shyt4zoc1#

我认为你没有安装react-markdown包。

相关问题