Skip to content

Commit b95cfe1

Browse files
committed
Merge branch 'master' of github.com:facebook/react
2 parents 382f399 + 06bf89d commit b95cfe1

File tree

8 files changed

+33
-12
lines changed

8 files changed

+33
-12
lines changed

docs/docs/10.4-test-utils.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Returns true if `instance` is a composite component (created with `React.createC
7373
boolean isCompositeComponentWithType(ReactComponent instance, function componentClass)
7474
```
7575

76-
The combination of `isComponentOfType()` and `isCompositeComponent()`.
76+
Returns true if `instance` is a composite component (created with `React.createClass()`) whose type is of a React `componentClass`.
7777

7878
### isTextComponent
7979

src/browser/ui/ReactDOMComponent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ ReactDOMComponent.Mixin = {
290290
// superfluous reconcile. It's possible for state to be mutable but such
291291
// change should trigger an update of the owner which would recreate
292292
// the element. We explicitly check for the existence of an owner since
293-
// it's possible for a element created outside a composite to be
293+
// it's possible for an element created outside a composite to be
294294
// deeply mutated and reused.
295295
return;
296296
}

src/browser/ui/ReactMount.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ var ReactMount = {
369369
typeof nextElement === 'function' ?
370370
' Instead of passing a component class, make sure to instantiate ' +
371371
'it by passing it to React.createElement.' :
372-
// Check if it quacks like a element
372+
// Check if it quacks like an element
373373
typeof nextElement.props !== "undefined" ?
374374
' This may be caused by unintentionally loading two independent ' +
375375
'copies of React.' :

src/browser/ui/__tests__/ReactDOMComponent-test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,10 @@ describe('ReactDOMComponent', function() {
175175

176176
it("should transition from innerHTML to string content", function() {
177177
var container = document.createElement('div');
178-
React.render(<div dangerouslySetInnerHTML={{__html: 'bonjour'}} />
179-
, container);
178+
React.render(
179+
<div dangerouslySetInnerHTML={{__html: 'bonjour'}} />,
180+
container
181+
);
180182

181183
expect(container.firstChild.innerHTML).toEqual('bonjour');
182184
React.render(<div>adieu</div>, container);

src/browser/ui/dom/CSSProperty.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717
var isUnitlessNumber = {
1818
columnCount: true,
19-
fillOpacity: true,
2019
flex: true,
2120
flexGrow: true,
2221
flexShrink: true,
@@ -28,7 +27,11 @@ var isUnitlessNumber = {
2827
orphans: true,
2928
widows: true,
3029
zIndex: true,
31-
zoom: true
30+
zoom: true,
31+
32+
// SVG-related properties
33+
fillOpacity: true,
34+
strokeOpacity: true
3235
};
3336

3437
/**

src/core/ReactComponent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ var ReactComponent = {
187187
'`render` method to pass the correct value as props to the component ' +
188188
'where it is created.'
189189
);
190-
// This is a deoptimized path. We optimize for always having a element.
190+
// This is a deoptimized path. We optimize for always having an element.
191191
// This creates an extra internal element.
192192
this._pendingElement = ReactElement.cloneAndReplaceProps(
193193
this._pendingElement || this._currentElement,
@@ -205,7 +205,7 @@ var ReactComponent = {
205205
* @internal
206206
*/
207207
_setPropsInternal: function(partialProps, callback) {
208-
// This is a deoptimized path. We optimize for always having a element.
208+
// This is a deoptimized path. We optimize for always having an element.
209209
// This creates an extra internal element.
210210
var element = this._pendingElement || this._currentElement;
211211
this._pendingElement = ReactElement.cloneAndReplaceProps(

src/core/__tests__/ReactTextComponent-test.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,28 @@ describe('ReactTextComponent', function() {
1818
React = require('React');
1919
});
2020

21-
it('should escape the rootID', function(){
21+
it('should escape the rootID', function() {
2222
var ThisThingShouldBeEscaped = '">>> LULZ <<<"';
2323
var ThisThingWasBeEscaped = '&quot;&gt;&gt;&gt; LULZ &lt;&lt;&lt;&quot;';
2424
var thing = <div><span key={ThisThingShouldBeEscaped}>LULZ</span></div>;
2525
var html = React.renderToString(thing);
2626
expect(html).not.toContain(ThisThingShouldBeEscaped);
2727
expect(html).toContain(ThisThingWasBeEscaped);
28-
})
28+
});
29+
30+
it('updates a mounted text component in place', function() {
31+
var el = document.createElement('div');
32+
var inst = React.render(<div>{'foo'}{'bar'}</div>, el);
33+
34+
var foo = inst.getDOMNode().children[0];
35+
var bar = inst.getDOMNode().children[1];
36+
expect(foo.tagName).toBe('SPAN');
37+
expect(bar.tagName).toBe('SPAN');
38+
39+
var inst = React.render(<div>{'baz'}{'qux'}</div>, el);
40+
// After the update, the spans should have stayed in place (as opposed to
41+
// getting unmounted and remounted)
42+
expect(inst.getDOMNode().children[0]).toBe(foo);
43+
expect(inst.getDOMNode().children[1]).toBe(bar);
44+
});
2945
});

src/utils/OrderedMap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ var OrderedMapMethods = {
175175

176176
/**
177177
* Returns the object for a given key, or `undefined` if not present. To
178-
* distinguish a undefined entry vs not being in the set, use `has()`.
178+
* distinguish an undefined entry vs not being in the set, use `has()`.
179179
*
180180
* @param {string} key String key to lookup the value for.
181181
* @return {Object?} Object at key `key`, or undefined if not in map.

0 commit comments

Comments
 (0)