-
Notifications
You must be signed in to change notification settings - Fork 48.8k
Type ReactComponentTreeHook #7504
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** | ||
* Copyright 2016-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
* @flow | ||
* @providesModule ReactElementType | ||
*/ | ||
|
||
'use strict'; | ||
|
||
import type { ReactInstance } from 'ReactInstanceType'; | ||
|
||
export type Source = { | ||
fileName: string, | ||
lineNumber: number, | ||
}; | ||
|
||
export type ReactElement = { | ||
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'm not sure how to name this one since it's going to conflict with the |
||
$$typeof: any, | ||
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 typed everything |
||
type: any, | ||
key: any, | ||
ref: any, | ||
props: any, | ||
_owner: ReactInstance, | ||
|
||
// __DEV__ | ||
_store: { | ||
validated: bool, | ||
}, | ||
_self: ReactElement, | ||
_shadowChildren: any, | ||
_source: Source, | ||
}; |
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.
I'm not sure if I should put them in this file (which is a bit random) or in a different file
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.
Relay has a
RelayTypes
andRelayInternalTypes
file, would there be any benefit here to implementing something similar to that approach, if the end goal is a fully typed codebase?