How to use the Polyfill with typescript?
See original GitHub issueHello,
I’m trying to use the polyfill with typescript, but I get the following errors which seems to me that the polyfill doesn’t have a typescript declaration file.
TypeScript error in Reader.tsx(2,33):
Could not find a declaration file for module 'react-resize-detector/build/withPolyfill'. '/node_modules/react-resize-detector/build/withPolyfill.js' implicitly has an 'any' type.
Try `npm install @types/react-resize-detector` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-resize-detector/build/withPolyfill';` TS7016
1 | import React, { useCallback, useMemo, useState } from 'react';
> 2 | import ReactResizeDetector from 'react-resize-detector/build/withPolyfill';
| ^
3 |
Could also https://github.com/maslianok/react-resize-detector/pull/137 be merged and released? Thanks!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Why do I need a polyfill with Typescript? - Stack Overflow
The TypeScript compiler levels down the syntax (recognizable by special characters like => , ? , ` , # and keywords like class...
Read more >Adding Polyfills in TypeScript App - MyDatahack
A polyfill is code that fills in functionality missing from the older browser. For example, Internet Explorer does not have Promise like ...
Read more >TARGET, LIB and POLYFILL for TypeScript and ... - YouTube
# TypeScript options that control desired ; #JavaScript runtime support. We will look at the ; #target compiler option, then the ; #lib...
Read more >ts-polyfill - npm
Runtime polyfills for TypeScript libs, powered by core-js! ... Start using ts-polyfill in your project by running `npm i ts-polyfill`.
Read more >Import polyfill using dynamic imports in TypeScript
Polyfills are often pasted from the internet, so you can use JavaScript or TypeScript depending on the source. Then, you can import them ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Should be fixed in 6.6.3
Please, try v6.6.1.
It should work now