ViewWithSize
Summary: _typescript_ Reviewed By: bnelo12 Differential Revision: D16830537 fbshipit-source-id: 2ca4854a0dd4c092b6e4b09aefeb676f5921fe9e
This commit is contained in:
committed by
Facebook Github Bot
parent
68271e2017
commit
115e2b3576
@@ -8,24 +8,24 @@
|
|||||||
import {Component} from 'react';
|
import {Component} from 'react';
|
||||||
|
|
||||||
type ViewWithSizeProps = {
|
type ViewWithSizeProps = {
|
||||||
onSize: (width: number, height: number) => any,
|
onSize: (width: number, height: number) => any;
|
||||||
};
|
};
|
||||||
|
|
||||||
type ViewWithSizeState = {|
|
type ViewWithSizeState = {
|
||||||
width: number,
|
width: number;
|
||||||
height: number,
|
height: number;
|
||||||
|};
|
};
|
||||||
|
|
||||||
export default class ViewWithSize extends Component<
|
export default class ViewWithSize extends Component<
|
||||||
ViewWithSizeProps,
|
ViewWithSizeProps,
|
||||||
ViewWithSizeState,
|
ViewWithSizeState
|
||||||
> {
|
> {
|
||||||
constructor(props: ViewWithSizeProps, context: Object) {
|
constructor(props: ViewWithSizeProps, context: Object) {
|
||||||
super(props, context);
|
super(props, context);
|
||||||
this.state = {height: window.innerHeight, width: window.innerWidth};
|
this.state = {height: window.innerHeight, width: window.innerWidth};
|
||||||
}
|
}
|
||||||
|
|
||||||
_onResize: Function;
|
_onResize: (event: UIEvent) => void;
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this._onResize = () => {
|
this._onResize = () => {
|
||||||
@@ -113,7 +113,7 @@ export {
|
|||||||
|
|
||||||
// utility elements
|
// utility elements
|
||||||
export {default as View} from './components/View.tsx';
|
export {default as View} from './components/View.tsx';
|
||||||
export {default as ViewWithSize} from './components/ViewWithSize.js';
|
export {default as ViewWithSize} from './components/ViewWithSize.tsx';
|
||||||
export {default as Block} from './components/Block.js';
|
export {default as Block} from './components/Block.js';
|
||||||
export {default as FocusableBox} from './components/FocusableBox.js';
|
export {default as FocusableBox} from './components/FocusableBox.js';
|
||||||
export {default as Sidebar} from './components/Sidebar.tsx';
|
export {default as Sidebar} from './components/Sidebar.tsx';
|
||||||
|
|||||||
Reference in New Issue
Block a user