mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
[react-measure][fix] Support useRef for innerRef prop on Measure (#41661)
* [react-measure][fix] Allow RefObject for innerRef prop on Measure * Fix semicolons
This commit is contained in:
parent
b8a56bd21b
commit
7397dcc6d0
2
types/react-measure/index.d.ts
vendored
2
types/react-measure/index.d.ts
vendored
@ -52,7 +52,7 @@ export interface MeasureProps {
|
||||
scroll?: boolean;
|
||||
bounds?: boolean;
|
||||
margin?: boolean;
|
||||
innerRef?(ref: Element | null): void;
|
||||
innerRef?: React.Ref<Element>;
|
||||
onResize?(contentRect: ContentRect): void;
|
||||
children?: React.SFC<MeasuredComponentProps>;
|
||||
}
|
||||
|
||||
@ -107,3 +107,8 @@ const funcEl = <MeasuredFunctionalComponent a="test" />;
|
||||
|
||||
const MeasuredClassComponent = withContentRect('bounds')<Props>(TestClassComponentWithProps);
|
||||
const classEl = <MeasuredClassComponent a="test" />;
|
||||
|
||||
function testInnerRefHook() {
|
||||
const ref = React.useRef<HTMLDivElement>();
|
||||
return <Measure innerRef={ref} />;
|
||||
}
|
||||
|
||||
@ -23,4 +23,4 @@
|
||||
"index.d.ts",
|
||||
"react-measure-tests.tsx"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user