mirror of
https://github.com/status-im/react-native.git
synced 2025-01-14 19:44:13 +00:00
Add invariant for null root ids
Reviewed By: astreet Differential Revision: D2911414 fb-gh-sync-id: 7d7a4144765e093de18b442f7304693556fdfc2f
This commit is contained in:
parent
1cf605dda3
commit
6b63afb097
@ -19,6 +19,7 @@ var ReactMultiChild = require('ReactMultiChild');
|
||||
var UIManager = require('UIManager');
|
||||
|
||||
var deepFreezeAndThrowOnMutationInDev = require('deepFreezeAndThrowOnMutationInDev');
|
||||
var invariant = require('invariant');
|
||||
var warning = require('warning');
|
||||
|
||||
var registrationNames = ReactNativeEventEmitter.registrationNames;
|
||||
@ -79,7 +80,7 @@ ReactNativeBaseComponent.Mixin = {
|
||||
// no children - let's avoid calling out to the native bridge for a large
|
||||
// portion of the children.
|
||||
if (mountImages.length) {
|
||||
|
||||
|
||||
// TODO: Pool these per platform view class. Reusing the `mountImages`
|
||||
// array would likely be a jit deopt.
|
||||
var createdTags = [];
|
||||
@ -189,10 +190,16 @@ ReactNativeBaseComponent.Mixin = {
|
||||
);
|
||||
|
||||
var nativeTopRootID = ReactNativeTagHandles.getNativeTopRootIDFromNodeID(rootID);
|
||||
if (nativeTopRootID == null) {
|
||||
invariant(
|
||||
false,
|
||||
'nativeTopRootID not found for tag ' + tag + ' view type ' +
|
||||
this.viewConfig.uiViewClassName + ' with rootID ' + rootID);
|
||||
}
|
||||
UIManager.createView(
|
||||
tag,
|
||||
this.viewConfig.uiViewClassName,
|
||||
nativeTopRootID ? ReactNativeTagHandles.rootNodeIDToTag[nativeTopRootID] : null,
|
||||
ReactNativeTagHandles.rootNodeIDToTag[nativeTopRootID],
|
||||
updatePayload
|
||||
);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user