patleeman / quill-markdown-shortcuts

Quill.js module that converts markdown to rich text formatting while typing.
https://patleeman.github.io/quill-markdown-shortcuts/
139 stars 49 forks source link

import in react project #21

Closed nerdware-timmmi closed 5 years ago

nerdware-timmmi commented 5 years ago

When trying to import the module in my project like this:

import Quill from 'quill';
import ReactQuill from 'react-quill';
import { MarkdownShortcuts} from 'quill-markdown-shortcuts/dist/markdownShortcuts';
import 'react-quill/dist/quill.snow.css';

I get the following error:

Uncaught ReferenceError: Quill is not defined
    at Object.eval (markdownShortcuts.js?2d26:431)
    at __webpack_require__ (markdownShortcuts.js?2d26:21)
    at Object.defineProperty.value (markdownShortcuts.js?2d26:104)
    at __webpack_require__ (markdownShortcuts.js?2d26:21)
    at eval (markdownShortcuts.js?2d26:64)
    at eval (markdownShortcuts.js?2d26:67)
    at Object../node_modules/quill-markdown-shortcuts/dist/markdownShortcuts.js (main.js:8683)
    at __webpack_require__ (main.js:724)
    at fn (main.js:101)
    at eval (QuillJsEditor.jsx:16)
mrowles commented 5 years ago

Any luck with this?

nickborti commented 5 years ago

Any suggestions? I get the same error.

mrowles commented 5 years ago

@nickborti in the interim, I just ripped the code into an independent module in my codebase, converted it to Tyescript and imported it, but if I have time I was going to convert it into an importable module.

nickborti commented 5 years ago

@mrowles Yeah, If it works, then go for it!

patleeman commented 5 years ago

Sorry for the delay. v0.0.7 has been released which makes the module importable.

doverradio commented 4 years ago

@patleeman can you please give example of how to use this with reactquill? I am facing same issue. Not sure how to do this import feature but very much want to use your library with reactquill.