Skip to content
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

Fix the typescript type declaration #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lulu-berlin
Copy link

@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

We lost an hour to this today

@lulu-berlin
Copy link
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