-
Notifications
You must be signed in to change notification settings - Fork 50.5k
Update Flow and fix issues #8006
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,22 +12,27 @@ | |
|
|
||
| 'use strict'; | ||
|
|
||
| import type {ReactElement} from 'ReactElementType'; | ||
|
|
||
| export type DebugID = number; | ||
|
|
||
| export type ReactInstance = { | ||
| // ReactCompositeComponent | ||
| // Shared | ||
| mountComponent: any, | ||
| unmountComponent: any, | ||
| receiveComponent: any, | ||
| getName: () => string, | ||
| getPublicInstance: any, | ||
| _currentElement: ReactElement, | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The only change is adding
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With the
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, those methods are shared. |
||
|
|
||
| // ReactCompositeComponent | ||
| performInitialMountWithErrorHandling: any, | ||
| performInitialMount: any, | ||
| getHostNode: any, | ||
| unmountComponent: any, | ||
| receiveComponent: any, | ||
| performUpdateIfNecessary: any, | ||
| updateComponent: any, | ||
| attachRef: (ref: string, component: ReactInstance) => void, | ||
| detachRef: (ref: string) => void, | ||
| getName: () => string, | ||
| getPublicInstance: any, | ||
| _rootNodeID: number, | ||
|
|
||
| // ReactDOMComponent | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,10 +20,8 @@ var getHostComponentFromComposite = require('getHostComponentFromComposite'); | |
| var instantiateReactComponent = require('instantiateReactComponent'); | ||
| var invariant = require('invariant'); | ||
|
|
||
| import type { ReactElement } from 'ReactElementType'; | ||
|
|
||
| export type TestRendererOptions = { | ||
| createNodeMock: (element: ReactElement) => any, | ||
| createNodeMock: (element: ReactElement<any>) => any, | ||
| }; | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is public API so I needed to use the "public" ReactElement definition provided by Flow. Otherwise tests in www fail.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don’t have a good understanding of the difference between
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand either 😄 . But at least it passes. |
||
|
|
||
| var defaultTestOptions = { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flow now errors on calling non-callables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn’t Flow understand this to be a
functionif it exists? https://github.com/facebook/flow/blob/master/lib/react.js#L74There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
¯_(ツ)_/¯