mariordev / mailtoui

A simple way to enhance your mailto links with a convenient user interface.
https://mailtoui.com
MIT License
192 stars 12 forks source link

Not Working with React Vite #47

Open ahsanmughal757 opened 1 year ago

ahsanmughal757 commented 1 year ago

I tried using it with vite react via npm: Code:

const MailtoUI = require('../node_modules/mailtoui/dist/mailtoui-min')

function App() {
    useEffect(() => {
        MailtoUI.run()
    }, [])

    return (
        // code with MailtoUI a tag
    );
}

Error:

Uncaught TypeError: MailtoUI.run is not a function
    at App.jsx?t=1688628587499:29:14
    at commitHookEffectListMount (react-dom_client.js?v=24e21016:16438:34)
    at commitPassiveMountOnFiber (react-dom_client.js?v=24e21016:17679:19)
    at commitPassiveMountEffects_complete (react-dom_client.js?v=24e21016:17652:17)
    at commitPassiveMountEffects_begin (react-dom_client.js?v=24e21016:17642:15)
    at commitPassiveMountEffects (react-dom_client.js?v=24e21016:17632:11)
    at flushPassiveEffectsImpl (react-dom_client.js?v=24e21016:18985:11)
    at flushPassiveEffects (react-dom_client.js?v=24e21016:18942:22)
    at commitRootImpl (react-dom_client.js?v=24e21016:18911:13)
    at commitRoot (react-dom_client.js?v=24e21016:18772:13)