Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish AutoSizer types #934

Merged
merged 1 commit into from
Dec 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"jsnext:main": "dist/es/index.js",
"license": "MIT",
"scripts": {
"build:types": "flow-copy-source --ignore \"**/*.{jest,e2e,example}.js\" source/WindowScroller dist/es/WindowScroller",
"build:types": "flow-copy-source --ignore \"**/*.{jest,e2e,example}.js\" source/WindowScroller dist/es/WindowScroller && flow-copy-source --ignore \"**/*.{jest,e2e,example}.js\" source/AutoSizer dist/es/AutoSizer ",
"build": "npm run build:commonjs && npm run build:css && npm run build:es && npm run build:demo && npm run build:umd",
"build:commonjs": "npm run clean:commonjs && cross-env NODE_ENV=production cross-env BABEL_ENV=commonjs babel source --out-dir dist/commonjs",
"build:css": "postcss source/styles.css -o styles.css --use autoprefixer",
Expand Down
17 changes: 10 additions & 7 deletions source/AutoSizer/AutoSizer.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
/** @flow */

import type {Size} from './types';

import * as React from 'react';
import createDetectElementResize from '../vendor/detectElementResize';

type Size = {
height: number,
width: number,
};

type Props = {
/** Function responsible for rendering children.*/
children: (warams: Size) => React.Element<*>,
children: Size => React.Element<*>,

/** Default height to use for initial render; useful for SSR */
defaultHeight?: number,
Expand All @@ -25,7 +28,7 @@ type Props = {
nonce?: string,

/** Callback to be invoked on-resize */
onResize: (params: Size) => void,
onResize: Size => void,
};

type State = {
Expand Down Expand Up @@ -92,8 +95,8 @@ export default class AutoSizer extends React.PureComponent<Props, State> {
// Outer div should not force width/height since that may prevent containers from shrinking.
// Inner component should overflow and use calculated width/height.
// See issue #68 for more information.
const outerStyle: any = {overflow: 'visible'};
const childParams: any = {};
const outerStyle: Object = {overflow: 'visible'};
const childParams: Object = {};

if (!disableHeight) {
outerStyle.height = 0;
Expand Down Expand Up @@ -159,7 +162,7 @@ export default class AutoSizer extends React.PureComponent<Props, State> {
}
};

_setRef = (autoSizer: HTMLElement | null) => {
_setRef = (autoSizer: ?HTMLElement) => {
this._autoSizer = autoSizer;
};
}
2 changes: 0 additions & 2 deletions source/AutoSizer/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// @flow

export type {Size} from './types';

export {default} from './AutoSizer';
export {default as AutoSizer} from './AutoSizer';
6 changes: 0 additions & 6 deletions source/AutoSizer/types.js

This file was deleted.