forked from facebook/react
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Walk down internal tree to find DOM node
This reduces our reliance on hierarchical IDs.
- Loading branch information
1 parent
4f9fdee
commit 5c5d2ec
Showing
7 changed files
with
80 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 0 additions & 48 deletions
48
src/renderers/shared/reconciler/ReactEmptyComponentRegistry.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** | ||
* Copyright 2013-2015, 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. | ||
* | ||
* @providesModule ReactNodeTypes | ||
*/ | ||
|
||
'use strict'; | ||
|
||
var ReactElement = require('ReactElement'); | ||
|
||
var invariant = require('invariant'); | ||
|
||
var ReactNodeTypes = { | ||
NATIVE: 0, | ||
COMPOSITE: 1, | ||
EMPTY: 2, | ||
|
||
getType: function(node) { | ||
if (node === null || node === false) { | ||
return ReactNodeTypes.EMPTY; | ||
} else if (ReactElement.isValidElement(node)) { | ||
if (typeof node.type === 'function') { | ||
return ReactNodeTypes.COMPOSITE; | ||
} else { | ||
return ReactNodeTypes.NATIVE; | ||
} | ||
} | ||
invariant(false, 'Unexpected node: %s', node); | ||
}, | ||
}; | ||
|
||
module.exports = ReactNodeTypes; |