Open Zorig opened 5 years ago
I noticed the same issue in my TypeScript project using @types/react-modal@3.8.2
. I worked around it by importing it with require
:
import ReactModal = require('react-modal')
@martindidiego @Zorig Can you investigate if this issue is related react-modal?
It's possible that @types/react-modal
(in DefinitelyTyped) needs to add ES module types for this package
Summary:
i am using react-modal 3.9.1 with typescript: 3.3.3 with nextjs 9 and when importing
ReactModal
it is giving me an error saying "ReferenceError: exports is not defined" i also used @types/react-modal:3.8.2. on a sandbox it is working without issue though. But still there is error sayingModule '"/sandbox/node_modules/@types/react-modal/index"' has no default export.ts(1192)
Steps to reproduce:
ReactModal from 'react-modal'
<ReactModal>
in render methodExpected behavior:
should work without issue
Link to example of issue:
https://codesandbox.io/embed/tender-leavitt-260ul
Additional notes: