Skip to content

Commit

Permalink
Merge pull request #2646 from lunij/v2-flowtype-update
Browse files Browse the repository at this point in the history
[V2] Flowtype upgrade to v0.72.0
  • Loading branch information
gwyneplaine committed Jun 19, 2018
2 parents 94df8a7 + 61f3cba commit cc3f1a1
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/pages/upgradeGuide/props.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ class PropChanges extends Component<
{ selectedOptions: Array<string>, filterValue: string }
> {
state = {
selectedOptions: allOptions.map(opt => opt.value),
selectedOptions: (allOptions.map(opt => opt.value): Array<string>),
filterValue: filterOptions[0].value,
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"eslint": "^4.6.1",
"eslint-plugin-react": "^7.3.0",
"extract-react-types-loader": "^0.1.2",
"flow-bin": "^0.68.0",
"flow-bin": "^0.72.0",
"gh-pages": "^1.1.0",
"html-webpack-plugin": "^2.30.1",
"husky": "^0.14.3",
Expand Down
1 change: 1 addition & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const globals = {
'react-input-autosize': 'AutosizeInput',
react: 'React',
};
// $FlowFixMe This should be inferred by Flow and manual casting does not work inside of this config.
const external = Object.keys(globals);
const babelOptions = () => {
let result = {
Expand Down
3 changes: 2 additions & 1 deletion src/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {

import {
defaultComponents,
type PlaceholderOrValue,
type SelectComponents,
type SelectComponentsConfig,
} from './components/index';
Expand Down Expand Up @@ -1141,7 +1142,7 @@ export default class Select extends Component<Props, State> {
/>
);
}
renderPlaceholderOrValue() {
renderPlaceholderOrValue(): ?PlaceholderOrValue {
const {
MultiValue,
MultiValueContainer,
Expand Down
10 changes: 9 additions & 1 deletion src/components/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// @flow
import type { ComponentType } from 'react';
import {
type ComponentType,
type Element,
} from 'react';
import {
type IndicatorContainerProps,
type ContainerProps,
Expand Down Expand Up @@ -42,6 +45,11 @@ import Option, { type OptionProps } from './Option';
import Placeholder, { type PlaceholderProps } from './Placeholder';
import SingleValue, { type SingleValueProps } from './SingleValue';

export type PlaceholderOrValue =
| Element<ComponentType<PlaceholderProps>>
| Element<ComponentType<SingleValueProps>>
| Array<Element<ComponentType<MultiValueProps>>>

type IndicatorComponentType = ComponentType<IndicatorProps>;

export type SelectComponents = {
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4056,9 +4056,9 @@ flatten@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.2.tgz#dae46a9d78fbe25292258cc1e780a41d95c03782"

flow-bin@^0.68.0:
version "0.68.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.68.0.tgz#86c2d14857d306eb2e85e274f2eebf543564f623"
flow-bin@^0.72.0:
version "0.72.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.72.0.tgz#12051180fb2db7ccb728fefe67c77e955e92a44d"

flush-write-stream@^1.0.0:
version "1.0.3"
Expand Down

0 comments on commit cc3f1a1

Please sign in to comment.