natelindev / react-use-hoverintent

React custom hook for hoverIntent
https://www.npmjs.com/package/react-use-hoverintent
MIT License
26 stars 4 forks source link

Build is missing #1

Closed stephanschubert closed 4 years ago

stephanschubert commented 4 years ago

Tried import { useHoverIntent } from "react-use-hoverintent";

Error:


import { useState, useEffect, useRef, useImperativeHandle } from 'react';
^^^^^^

SyntaxError: Cannot use import statement outside a module```
natelindev commented 4 years ago

If you are using this on node.js add this to your package.json

{
  "type": "module"
}
dariusrosendahl commented 4 years ago

Hi,

Love the package but I was running into the same problem as @stephanschubert

I added babel and exported it differently so it can be imported normally and published it for myself since I need it right now but I also made a PR so it can be merged back: https://github.com/llldar/react-use-hoverintent/pull/2

Please take a look. (Since I published it you'll need to change the package name and version back to what your repo needs)

natelindev commented 4 years ago

It should be fixed with version 1.20, closing now.