Skip to content

Commit

Permalink
Merge pull request #840 from hallettj/fixes-for-flow-v0.47.0
Browse files Browse the repository at this point in the history
Fixes for Flow v0.47.0
  • Loading branch information
k15a authored Jun 6, 2017
2 parents 07c8317 + 9fa6040 commit e0f5fa2
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ All notable changes to this project will be documented in this file. If a contri
- Restore `setNativeProps` in StyledNativeComponent, thanks to [@MatthieuLemoine](https://github.com/MatthieuLemoine). (see [#764](https://github.com/styled-components/styled-components/pull/764))
- Fix `ref` being passed to Stateless Functional Components in StyledNativeComponent. (see [#828](https://github.com/styled-components/styled-components/pull/828))
- Add `displayName` to `componentId` when both are present (see [#821](https://github.com/styled-components/styled-components/pull/821))
- Fix Flow type signatures for compatibility with Flow v0.47.0 (see [#840](https://github.com/styled-components/styled-components/pull/840))

## [v1.4.6] - 2017-05-02

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"eslint-plugin-jsx-a11y": "^2.0.2",
"eslint-plugin-react": "^6.8.0",
"express": "^4.14.1",
"flow-bin": "^0.43.1",
"flow-bin": "^0.47.0",
"flow-copy-source": "^1.1.0",
"flow-watch": "^1.1.1",
"jest": "^19.0.2",
Expand Down
6 changes: 4 additions & 2 deletions src/models/StyleSheetManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ class StyleSheetManager extends Component {

render() {
/* eslint-disable react/prop-types */
// $FlowFixMe
return React.Children.only(this.props.children)
// Flow v0.43.1 will report an error accessing the `children` property,
// but v0.47.0 will not. It is necessary to use a type cast instead of
// a "fixme" comment to satisfy both Flow versions.
return React.Children.only((this.props: any).children)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/theme.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ describe('theming', () => {
},
}

const Theme = ({ props }) => (
const Theme = props => (
<ThemeProvider theme={{ color: 'green' }}>
<Text {...props} />
</ThemeProvider>
Expand Down
2 changes: 1 addition & 1 deletion src/utils/create-broadcast.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

export type Broadcast = {
publish: (value: mixed) => void,
subscribe: (listener: () => void) => () => void
subscribe: (listener: (currentValue: mixed) => void) => () => void
}

const createBroadcast = (initialValue: mixed): Broadcast => {
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2499,9 +2499,9 @@ flat-cache@^1.2.1:
graceful-fs "^4.1.2"
write "^0.2.1"

flow-bin@^0.43.1:
version "0.43.1"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.43.1.tgz#0733958b448fb8ad4b1576add7e87c31794c81bc"
flow-bin@^0.47.0:
version "0.47.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.47.0.tgz#a2a08ab3e0d1f1cb57d17e27b30b118b62fda367"

flow-copy-source@^1.1.0:
version "1.1.0"
Expand Down

0 comments on commit e0f5fa2

Please sign in to comment.