Skip to content

Fix the typescript type declaration#52

Open
lulu-berlin wants to merge 1 commit intoque-etc:masterfrom
lulu-berlin:patch-1
Open

Fix the typescript type declaration#52
lulu-berlin wants to merge 1 commit intoque-etc:masterfrom
lulu-berlin:patch-1

Conversation

@lulu-berlin
Copy link
Copy Markdown

@lulu-berlin lulu-berlin commented Mar 14, 2019

In typescript (with webpack), a default import doesn't work:

import ResizeObserver from 'resize-observer-polyfill';

but a star import or an import = require import do work:

import * as ResizeObserver from 'resize-observer-polyfill';

or:

import ResizeObserver = require('resize-observer-polyfill');

Apparently there is a closed issue about this. This fixes #24.

In typescript (with webpack), a default import doesn't work:
```
import ResizeObserver from 'resize-observer-polyfill';
```
but a star import or an `import = require` import work:
```
import * as ResizeObserver from 'resize-observer-polyfill';
```
or:
```
import ResizeObserver = require('resize-observer-polyfill');
```

This change fixes this issue.
@walkerburgin
Copy link
Copy Markdown

We lost an hour to this today

@lulu-berlin
Copy link
Copy Markdown
Author

We lost an hour to this today

Sorry, @walkerburgin, seems like this repository is not being maintained... My PR has been left hanging for a long time.

We have created a fork in our organization with this fix applied: https://github.com/bettermarks/resize-observer-polyfill

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wrong export in typescript declaration

2 participants