Update TS typings for Popper
See original GitHub issueI’ve just update MUI next to beta 37 and with it popper at v1.14
(previously it was v1.12
). But not the TS compiler would complain about wrong typings:
node_modules/react-popper/react-popper.d.ts(38,17): error TS2503: Cannot find namespace 'PopperJS'.
I guess instead of:
import PopperJS from "popper.js";
const v: PopperJS.Placement;
we should use:
import {Placement} from "popper.js";
const v: Placement;
or
import * as PopperJS from "popper.js";
const v: PopperJS.Placement;
Issue Analytics
- State:
- Created 6 years ago
- Reactions:12
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Update TS typings for Popper · Issue #101 - GitHub
I've just update MUI next to beta 37 and with it popper at v1.14 (previously it was v1.12 ). But not the TS...
Read more >Typings | Popper
Typings. Popper comes with type definitions for both Flow and TypeScript. The project is type checked by Flow, and type definitions for TypeScript...
Read more >Bootstrap 4 TypeScript Type Definition fails to compile
It appears my Bootstrap type definition file fails compilation as it cannot find the popper. js module.
Read more >@popperjs/core - npm
Popper solves all of these key problems in an elegant, performant manner. It is a lightweight ~3 kB library that aims to provide...
Read more >Usage of Angular libraries published to npm
Typically, library packages include typings in .d.ts files; see examples in ... To check for updates to your installed libraries, use the ng...
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
Oh fuck, I hate TypeScript, it’s so fucking cryptic… Would it be a solution if a dropped support for it from Popper.js completely? I can’t stand it anymore 😩
Bloody me and the day I decided to merge the TS support PR…
😆 @FezVrasta I don’t think you need to. Changing the way this lib declares the import should suffice. There is already a PR here that addresses the typings, it just needs to be changed slightly.
I’ve just testd with
import * as PopperJS from "popper.js";
instead ofimport PopperJS from "popper.js";
and it seems to work.Ideally you’d always import the necessary exported objects from the lib instead of everything: