eiriklv / react-masonry-component

A React.js component for using @desandro's Masonry
MIT License
1.44k stars 145 forks source link

Will not compile with TypeScript #45

Closed robinelvin closed 8 years ago

robinelvin commented 8 years ago

With

import * as Masonry from 'react-masonry-component';

I get

ERROR in /media/website/js/node_modules/react-masonry-component/typings.d.ts
(5,22): error TS2665: Module augmentation cannot introduce new names in the top level scope.

ERROR in /media/website/js/node_modules/react-masonry-component/typings.d.ts
(20,15): error TS2665: Module augmentation cannot introduce new names in the top level scope.

ERROR in /media/website/js/node_modules/react-masonry-component/typings.d.ts
(29,26): error TS2665: Module augmentation cannot introduce new names in the top level scope.

"typescript": "^1.8.10" "react-masonry-component": "^4.2.0"

EDIT: I see this could be a duplicate of #42

afram commented 8 years ago

This is a 'known' issue and probably a won't fix.

The issue is that the definitions are for typescript 2.0.0. You will need to copy/paste your own bindings for previous typescript versions.

The instructions are in that issue you referenced

robinelvin commented 8 years ago

Thanks @afram I can confirm that switching to Typescript 2.x fixes the error