Skip to content

Default export is not working with typescript #497

Open
@testerez

Description

@testerez

Summary:

Using typescript, if I import with import ReactModal from 'react-modal'; then ReactModal is undefined. It usually means that the module has no default export.
import * as ReactModal from 'react-modal'; works but does not satisfy the definitions from @types/react-modal@2.2.1

Steps to reproduce:

test.ts

import ReactModal from 'react-modal';
console.log(ReactModal);

ts-node test.ts

Expected behavior:

Should log a component but logs undefined

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions