-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with TypeScript #246
Comments
Please be sure you're on the latest version - there is a default export. |
Installing it with |
My mistake, the newest definition wasn't in a release yet. I just released |
Thank you very much, typings issue is gone now :) ! I'll try to figure out now why doing now import Draggable from 'react-draggable'; gives me |
Hi, I have the same problem, I get I'm using |
@etienne-dldc The problem was I was using |
@crsanti What if I need to use commonjs for other libraries I use? |
@crsanti typescript doc says that the default value for "module" options is |
Sorry, it was a mistake on my config, I got it working with |
I'm getting this undefined error as well now. It's not an option for me to change my entire module import type from commonjs to es6 as I have many other things depending on it. Are there any other options? This library looks great! Typescript 2.3.4 and react draggable 2.2.6 |
There's definitely a problem. If I use "module": "es6" in tsconfig, then I have to create my own typings:
And then importing as
|
Same problem here as well. Can use the using package.json: Any suggestions? |
If you guys can figure out what the correct exports should be I'm happy to
cut a major and change it.
…On Jul 28, 2017 12:11 PM, "Ronny Hanssen" ***@***.***> wrote:
Same problem here as well. Can use the any construct as suggested, but -
yes then typings are gone. I could not get it working as suggested in the
#226 <#226> case
neither.
using package.json: "react-draggable": "^2.2.6",
Any suggestions?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#246 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABJFPxSBxZ4IEMLWx8VN7LenwUAz_RtAks5sShZOgaJpZM4NMr4d>
.
|
Since webpack exposes the library for UMD as: module.exports = factory(/* some dependencies */); Watching another umd libs like exports = moment; So I think (I'm not 100% sure) that the only way that TypeScript can consume import * as Draggable from 'react-draggable'; // not undefined For import Draggable from 'react-draggable';
import * as Draggable from 'react-draggable'; // both are not undefined But right now using the above syntax will produce typings issues so.. I'll keep researching about this to get the correct typings. |
You mean Anyway. It seems to me (at a glance) that the named exports from BTW: I am using |
Same issue here with "awesome-typescript-loader": "3.2.2", "typescript": "2.4.2" and "module": "commonjs" using "react-draggable": "^3.0.3": import * as Draggable from 'react-draggable';
...
render() {
<Draggable>
...
</Draggable>
} results in TS2604: JSX element type 'Draggable' does not have any construct or call signatures. I dont know why this issue is closed. |
Hi, I'm working with TypeScript and installed
react-draggable
.As it is said in the doc touse the
<Draggable />
component I need to import as default:But when I try to import it:
I get the
Module "react-draggable" has no default export.
error. Doing:brings me the
<Draggable />
component but in TypeScript syntaxis* as
also brings all definitions and typings so I can't use it as a component (error:JSX element type 'Draggable' does not have any construct or call signatures.
)I only can use it is:
but it's weird since this package already gives typings.
I'm using
typescript
2.3.2 andawesome-typescript-loader
3.1.3. Anyone has encountered this issue?PD: Big thanks to give typings. This is an awesome package!
The text was updated successfully, but these errors were encountered: