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

Fix Flow typing for Flow v0.82 #1230

Merged
merged 1 commit into from Oct 4, 2018

Conversation

ngyikp
Copy link
Contributor

@ngyikp ngyikp commented Oct 4, 2018

https://github.com/facebook/flow/releases/tag/v0.82.0: Removed the ability to use functions as type annotations.

The old/current code will prompt this Flow error:

Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ node_modules/preact/dist/preact.js.flow:5:16

Cannot use function type as a type because function type is a value. To get the type of a value use typeof.

     2│
     3│ import { createElement, cloneElement, Component, type Node } from 'react';
     4│
     5│ declare var h: createElement;
     6│
     7│ declare function render(vnode: Node, parent: Element, toReplace?: Element): Element;
     8│



Found 1 error
error Command failed with exit code 2.

https://github.com/facebook/flow/releases/tag/v0.82.0

“Removed the ability to use functions as type annotations.”
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling d445fa4 on ngyikp:fix-flow-0-82 into 8b2f56a on developit:master.

Copy link
Member

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks for spotting this and making a PR 🎉 👍 👍

@marvinhagemeister marvinhagemeister merged commit 329d7c1 into preactjs:master Oct 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants