mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 07:40:10 +00:00
Added renderComponent to props (#36600)
Updating tests Removed onChange from test class Updated version to 8.1
This commit is contained in:
committed by
Ryan Cavanaugh
parent
6fef8d046a
commit
e3ea65c572
3
types/react-image-crop/index.d.ts
vendored
3
types/react-image-crop/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for react-image-crop 8.0
|
||||
// Type definitions for react-image-crop 8.1
|
||||
// Project: https://github.com/DominicTobias/react-image-crop
|
||||
// Definitions by: Daniela Yassuda <https://github.com/danielasy>
|
||||
// Elias Chaaya <https://github.com/chaaya>
|
||||
@@ -42,6 +42,7 @@ declare namespace ReactCrop {
|
||||
onImageError?: (event: React.SyntheticEvent<HTMLImageElement>) => void;
|
||||
className?: string;
|
||||
locked?: boolean;
|
||||
renderComponent?: ReactNode;
|
||||
renderSelectionAddon?: (state: any) => ReactNode;
|
||||
}
|
||||
|
||||
|
||||
@@ -61,6 +61,25 @@ class AspectRatioTest extends React.Component<{}, TestState> {
|
||||
}
|
||||
}
|
||||
|
||||
// Testing renderComponent
|
||||
class RenderComponentTest extends React.Component {
|
||||
render() {
|
||||
const videoComponent = (
|
||||
<video autoPlay loop style={{ display: 'block', maxWidth: '100%' }}>
|
||||
<source src="sample.mp4" type="video/mp4" />
|
||||
</video>
|
||||
);
|
||||
|
||||
return (
|
||||
<ReactCrop
|
||||
src="imageSrc"
|
||||
onChange={(crop) => console.log(crop)}
|
||||
renderComponent={videoComponent}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// All available props
|
||||
class CompleteTest extends React.Component<{}, TestState> {
|
||||
state = initialState;
|
||||
@@ -110,6 +129,7 @@ class CompleteTest extends React.Component<{}, TestState> {
|
||||
onImageError={this.onImageError}
|
||||
className="my-cropper"
|
||||
locked={false}
|
||||
renderComponent={<div></div>}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user