Skip to content

Commit 778ca2f

Browse files
committed
Merge pull request #1598 from syranide/nogettext
Un-mixin ReactBrowserComponentMixin from ReactTextComponent
2 parents c14b3a1 + 14ba6ee commit 778ca2f

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

src/browser/ReactTextComponent.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ var ReactTextComponent = function(props) {
4747
};
4848

4949
mixInto(ReactTextComponent, ReactComponent.Mixin);
50-
mixInto(ReactTextComponent, ReactBrowserComponentMixin);
5150
mixInto(ReactTextComponent, {
5251

5352
/**

src/core/__tests__/ReactMultiChildText-test.js

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ var updateChildren = function(d, children) {
5858
};
5959

6060
var expectChildren = function(d, children) {
61+
var textNode;
6162
if (typeof children === 'string') {
62-
var textNode = d.getDOMNode().firstChild;
63+
textNode = d.getDOMNode().firstChild;
6364

6465
if (children === '') {
6566
expect(textNode != null).toBe(false);
@@ -75,13 +76,20 @@ var expectChildren = function(d, children) {
7576
var child = children[i];
7677

7778
if (typeof child === 'string') {
78-
var textWrapperNode =
79-
reactComponentExpect(d)
80-
.expectRenderedChildAt(i)
81-
.toBeTextComponent()
82-
.instance();
83-
84-
expectChildren(textWrapperNode, child);
79+
reactComponentExpect(d)
80+
.expectRenderedChildAt(i)
81+
.toBeTextComponent()
82+
.instance();
83+
84+
textNode = d.getDOMNode().childNodes[i].firstChild;
85+
86+
if (child === '') {
87+
expect(textNode != null).toBe(false);
88+
} else {
89+
expect(textNode != null).toBe(true);
90+
expect(textNode.nodeType).toBe(3);
91+
expect(textNode.data).toBe('' + child);
92+
}
8593
} else {
8694
var elementDOMNode =
8795
reactComponentExpect(d)

0 commit comments

Comments
 (0)