mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
[react-cropper] Made ref property optional (#35259)
* [react-cropper] Made ref property optional * Add missing semicolon
This commit is contained in:
parent
82d9295a46
commit
14c84d853f
2
types/react-cropper/index.d.ts
vendored
2
types/react-cropper/index.d.ts
vendored
@ -11,7 +11,7 @@ import * as React from 'react';
|
||||
type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
|
||||
|
||||
export interface ReactCropperProps extends cropperjs.CropperOptions, Omit<React.HTMLProps<HTMLImageElement>, 'data' | 'ref'> {
|
||||
ref: string | ((cropper: null | ReactCropper) => any);
|
||||
ref?: string | ((cropper: null | ReactCropper) => any);
|
||||
}
|
||||
|
||||
interface ReactCropper extends cropperjs {} // tslint:disable-line no-empty-interface
|
||||
|
||||
@ -24,7 +24,7 @@ class Demo extends React.Component {
|
||||
}
|
||||
|
||||
function testCropperRef() {
|
||||
<Cropper
|
||||
const refIsWorking = <Cropper
|
||||
ref={(el: Cropper) => {
|
||||
// $ExpectError el can be null
|
||||
el.getCroppedCanvas();
|
||||
@ -36,4 +36,6 @@ function testCropperRef() {
|
||||
}
|
||||
}}
|
||||
/>;
|
||||
|
||||
const refIsOptional = <Cropper />;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user