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

Fixes for Flow v0.47.0 #840

Merged
merged 4 commits into from Jun 6, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
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
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
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
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
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
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