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

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maclockard committed Sep 16, 2019
1 parent ccb1c20 commit a0b407e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
14 changes: 7 additions & 7 deletions .size-snapshot.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"dist/index.umd.js": {
"bundled": 66132,
"minified": 23326,
"gzipped": 7037
"bundled": 51335,
"minified": 17586,
"gzipped": 5578
},
"dist/index.umd.min.js": {
"bundled": 31719,
"minified": 12888,
"gzipped": 4197
"bundled": 25434,
"minified": 9901,
"gzipped": 3388
},
"dist/index.esm.js": {
"bundled": 11581,
"minified": 6824,
"gzipped": 1882,
"gzipped": 1880,
"treeshaked": {
"rollup": {
"code": 3796,
Expand Down
2 changes: 1 addition & 1 deletion src/Popper.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import PopperJS, {
} from 'popper.js';
import type { Style } from 'typed-styles';
import { ManagerContext } from './Manager';
import { safeInvoke, unwrapArray, setRef } from './utils';
import { unwrapArray, setRef } from './utils';
import { type Ref } from "./RefTypes";

type ReferenceElement = ReferenceObject | HTMLElement | null;
Expand Down
2 changes: 1 addition & 1 deletion src/Reference.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class InnerReference extends React.Component<
};

componentWillUnmount() {
setRef(this.props.innerRef, node)
setRef(this.props.innerRef, null)
}

render() {
Expand Down
11 changes: 7 additions & 4 deletions typings/react-popper.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ interface ManagerProps {
export class Manager extends React.Component<ManagerProps, {}> { }

interface ReferenceChildrenProps {
ref: React.Ref<HTMLElement | SVGElement | null>;
// React refs are supposed to be contravariant (allows a more general type to be passed rather than a more specific one)
// However, Typescript currently can't infer that fact for refs
// See https://github.com/microsoft/TypeScript/issues/30748 for more information
ref: React.Ref<any>;
}

interface ReferenceProps {
Expand All @@ -17,23 +20,23 @@ interface ReferenceProps {
export class Reference extends React.Component<ReferenceProps, {}> { }

export interface PopperArrowProps {
ref: React.Ref<HTMLElement | SVGElement | null>;
ref: React.Ref<any>;
style: React.CSSProperties;
}

export interface PopperChildrenProps {
arrowProps: PopperArrowProps;
outOfBoundaries: boolean | null;
placement: PopperJS.Placement;
ref: React.Ref<HTMLElement | SVGElement | null>;
ref: React.Ref<any>;
scheduleUpdate: () => void;
style: React.CSSProperties;
}

export interface PopperProps {
children: (props: PopperChildrenProps) => React.ReactNode;
eventsEnabled?: boolean;
innerRef?: React.Ref<HTMLElement | SVGElement | null>;
innerRef?: React.Ref<any>;
modifiers?: PopperJS.Modifiers;
placement?: PopperJS.Placement;
positionFixed?: boolean;
Expand Down

0 comments on commit a0b407e

Please sign in to comment.