Type ReactChildrenMutationWarningHook (#7571)

This commit is contained in:
Christopher Chedeau
2016-08-26 14:46:57 -07:00
committed by GitHub
parent b977cf13c4
commit e2ddbac35e
@@ -7,6 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule ReactChildrenMutationWarningHook
* @flow
*/
'use strict';
@@ -15,6 +16,8 @@ var ReactComponentTreeHook = require('ReactComponentTreeHook');
var warning = require('warning');
import type { DebugID } from 'ReactInstanceType';
function handleElement(debugID, element) {
if (element == null) {
return;
@@ -47,10 +50,10 @@ function handleElement(debugID, element) {
}
var ReactChildrenMutationWarningHook = {
onMountComponent(debugID) {
onMountComponent(debugID: DebugID): void {
handleElement(debugID, ReactComponentTreeHook.getElement(debugID));
},
onUpdateComponent(debugID) {
onUpdateComponent(debugID: DebugID): void {
handleElement(debugID, ReactComponentTreeHook.getElement(debugID));
},
};