Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit bf6349b

Browse files
xaviergonzFezVrasta
authored andcommitted
fix: Don't rely on Popper.js namespace for TS types(#103)
When you compile the current code with TS 2.6.2 (didn't try others, and at least with allowSyntheticDefaultImports set to false) it gives the following errors: ``` build/0/compileTypescript/0 node_modules/react-popper/react-popper.d.ts(30,27): error TS2503: Cannot find namespace 'PopperJS'. build/0/compileTypescript/0 build/0/compileTypescript/0 30 ["data-placement"]: PopperJS.Placement; build/0/compileTypescript/0 ~~~~~~~~ build/0/compileTypescript/0 build/0/compileTypescript/0 build/0/compileTypescript/0 node_modules/react-popper/react-popper.d.ts(38,17): error TS2503: Cannot find namespace 'PopperJS'. build/0/compileTypescript/0 build/0/compileTypescript/0 38 modifiers?: PopperJS.Modifiers; build/0/compileTypescript/0 ~~~~~~~~ build/0/compileTypescript/0 build/0/compileTypescript/0 build/0/compileTypescript/0 node_modules/react-popper/react-popper.d.ts(39,17): error TS2503: Cannot find namespace 'PopperJS'. build/0/compileTypescript/0 build/0/compileTypescript/0 39 placement?: PopperJS.Placement; ``` This little fix fixed that.
1 parent 3ced3f0 commit bf6349b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

react-popper.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
declare module "react-popper" {
22
import * as React from "react";
3-
import PopperJS from "popper.js";
3+
import * as PopperJS from "popper.js";
44

55
interface IRestProps {
66
restProps: {

0 commit comments

Comments
 (0)