-
Notifications
You must be signed in to change notification settings - Fork 47.7k
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
Clean up ReactTestRenderer #7716
Conversation
@@ -7,6 +7,7 @@ | |||
* of patent rights can be found in the PATENTS file in the same directory. | |||
* | |||
* @providesModule ReactTestRenderer | |||
* @flow |
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.
@gaearon should I add flow as a separate PR? I know you mentioned keeping style changes separate from feature changes, but I wasn't sure where flow landed on that spectrum.
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 is fine now that we have a better idea how to use it thanks to PRs from @vjeux!
mountComponent( | ||
transaction: ReactTestReconcileTransaction, | ||
nativeParent: null | ReactTestComponent, | ||
nativeContainerInfo: ?null, |
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 wasn't too sure if I typed nativeParent
and nativeContainerInfo
correctly. From what I could tell, nativeParent
is either null or another instance of ReactTestComponent
, and nativeContainerInfo
was either null
or undefined
.
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.
nativeContainerInfo was either null or undefined
haha, sounds about right.
Seems all right, thanks. |
* create ReactTestTextComponent fil * create ReactTestEmptyComponent * Use class for ReactTestRenderer * Add flow to ReactTestRenderer (cherry picked from commit 5a3abab)
This breaks out
ReactTestTextComponent
andReactTestEmptyComponent
into their own files so the main ReactTestRenderer.js file is a little cleaner.I also implemented
ReactTestRenderer
with an ES6 class + flow types.cc @gaearon @spicyj