Skip to content

Commit c22b2da

Browse files
committed
Deploying to gh-pages from @ ff0e4f4 🚀
1 parent d7405a6 commit c22b2da

3 files changed

Lines changed: 24 additions & 12 deletions

File tree

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import React from 'react';
22
import Resizable from '../lib/Resizable';
33
import ResizableBox from '../lib/ResizableBox';
4+
import type {ResizeCallbackData} from '../lib/propTypes';
45
import 'style-loader!css-loader!../css/styles.css';
56

6-
/* global __VERSION__, __GIT_TAG__, __GIT_COMMIT__ */
7+
declare const __VERSION__: string;
8+
declare const __GIT_TAG__: string;
9+
declare const __GIT_COMMIT__: string;
710

811
// Update the version badge in the header
912
function updateVersionBadge() {
@@ -23,7 +26,7 @@ if (typeof document !== 'undefined') {
2326
}
2427
}
2528

26-
const CustomResizeHandle = React.forwardRef((props, ref) => {
29+
const CustomResizeHandle = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement> & {handleAxis?: string}>((props, ref) => {
2730
const {handleAxis, ...restProps} = props;
2831
return (
2932
<div
@@ -34,8 +37,17 @@ const CustomResizeHandle = React.forwardRef((props, ref) => {
3437
);
3538
});
3639

37-
export default class ExampleLayout extends React.Component<{}, {width: number, height: number}> {
38-
state = {
40+
type State = {
41+
width: number;
42+
height: number;
43+
absoluteWidth: number;
44+
absoluteHeight: number;
45+
absoluteLeft: number;
46+
absoluteTop: number;
47+
};
48+
49+
export default class ExampleLayout extends React.Component<{}, State> {
50+
state: State = {
3951
width: 200,
4052
height: 200,
4153
absoluteWidth: 200,
@@ -49,12 +61,12 @@ export default class ExampleLayout extends React.Component<{}, {width: number, h
4961
};
5062

5163
// On top layout
52-
onFirstBoxResize = (event, {element, size, handle}) => {
64+
onFirstBoxResize = (_event: React.SyntheticEvent, {size}: ResizeCallbackData) => {
5365
this.setState({width: size.width, height: size.height});
5466
};
5567

5668
// On bottom layout. Used to resize the center element around its flex parent.
57-
onResizeAbsolute = (event, {element, size, handle}) => {
69+
onResizeAbsolute = (_event: React.SyntheticEvent, {size, handle}: ResizeCallbackData) => {
5870
this.setState((state) => {
5971
let newLeft = state.absoluteLeft;
6072
let newTop = state.absoluteTop;

examples/bundle.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)