Closed neopostmodern closed 6 months ago
const options: any = {
disableHtml: true,
};
if (jsonState.length) {
options.json = jsonState;
} else {
options.markdown = markdown;
}
const muya = new Muya(editorRef.current, options);
muya.init();
you can put your markdown in the options, and call muya.init
There is an example in the example folder.
Why not call init
inside constructor instead of calling init()
explicitly?
Describe the bug All of the functions on an instantiated Muya are undefined. Below is just one example, I inspected the object and all functions are
undefined
.To Reproduce
Upon execution you immediately get "TypeError: muya.setContent is not a function"
Expected behavior Use the functions.
Actual behavior Error is thrown.
Operation System and Browser version (please complete the following information):
Muya Version 0.2.5