'Trying to add React Draft Wysiwyg in nextjs

React Draft Wysiwyg Editor

TypeError: draft to markdown is not a function

Error Image


import React, { Component } from 'react';
import { convertToRaw } from 'draft-js';
import { Editor } from 'react-draft-wysiwyg';
import draftToMarkdown from 'draftjs-to-markdown';
draftToMarkdown(convertToRaw(editorState.getCurrentContent()))

I have also tried this but not working :

const draftToMarkdown = dynamic(() => import("draftjs-to-markdown"), {ssr: false});


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source