Definitelytyped: Module "classnames" definition does not support ES6 module definition

Created on 15 Apr 2016  ·  3Comments  ·  Source: DefinitelyTyped/DefinitelyTyped

  • [x] I tried using the latest classnames/classnames.d.ts file in this repo and had problems.

image

As I result I get message "Module 'classnames' has no default export".

Most helpful comment

you should use import * as classnames from "classnames";.
https://github.com/JedWatson/classnames/blob/master/index.js#L39

All 3 comments

you should use import * as classnames from "classnames";.
https://github.com/JedWatson/classnames/blob/master/index.js#L39

@vvakame, Thanks. I'll try. The strange thing is that this also works:

import classnames from 'classnames';

I get typescript error but everything works.

Time to get back to this due to original package change: PR #25205 or PR #25206

Was this page helpful?
0 / 5 - 0 ratings