Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/browser/server/ReactServerRendering.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ var invariant = require('invariant');

/**
* @param {ReactElement} element
* @param {?object} context
* @return {string} the HTML markup
*/
function renderToString(element) {
Expand All @@ -49,7 +48,6 @@ function renderToString(element) {

/**
* @param {ReactElement} element
* @param {?object} context
* @return {string} the HTML markup, without the extra React ID and checksum
* (for generating static pages)
*/
Expand Down
2 changes: 1 addition & 1 deletion src/browser/ui/ReactDOMTextComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var ReactDOMTextComponent = function(props) {
assign(ReactDOMTextComponent.prototype, {

/**
* @param {ReactText} node
* @param {ReactText} text
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our runtime typecheck transform fails here because it text and node don't match (more specifically, I think it will fail if you specify things in the docblock that aren't in the parameters, but not visa versa)

* @internal
*/
construct: function(text) {
Expand Down
2 changes: 1 addition & 1 deletion src/browser/ui/__tests__/ReactDOMTextComponent-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('ReactDOMTextComponent', function() {
expect(foo.tagName).toBe('SPAN');
expect(bar.tagName).toBe('SPAN');

var inst = React.render(<div>{'baz'}{'qux'}</div>, el);
inst = React.render(<div>{'baz'}{'qux'}</div>, el);
// After the update, the spans should have stayed in place (as opposed to
// getting unmounted and remounted)
expect(inst.getDOMNode().children[0]).toBe(foo);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,7 @@ describe('ReactDOMSelect', function() {
});

it('should reset child options selected when they are changed and `value` is set', function() {
var stub =
<select multiple={true} value={["a", "b"]}>
</select>
var stub = <select multiple={true} value={["a", "b"]} />;
stub = ReactTestUtils.renderIntoDocument(stub);

stub.setProps({
Expand All @@ -149,9 +147,9 @@ describe('ReactDOMSelect', function() {
<option value="b">b</option>,
<option value="c">c</option>
]
})
});

var node = stub.getDOMNode()
var node = stub.getDOMNode();

expect(node.options[0].selected).toBe(true); // a
expect(node.options[1].selected).toBe(true); // b
Expand Down
2 changes: 1 addition & 1 deletion src/core/ReactComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ var ReactComponent = {
invariant(
false,
'getPublicInstance should never be called on the base class. It must ' +
'be overriden.'
'be overridden.'
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/core/ReactCompositeComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@ var ReactPerf = require('ReactPerf');
var ReactPropTypeLocations = require('ReactPropTypeLocations');
var ReactUpdates = require('ReactUpdates');

var emptyObject = require('emptyObject');
var assign = require('Object.assign');
var emptyObject = require('emptyObject');
var invariant = require('invariant');
var keyMirror = require('keyMirror');
var monitorCodeUse = require('monitorCodeUse');
var shouldUpdateReactComponent = require('shouldUpdateReactComponent');
var warning = require('warning');

Expand Down Expand Up @@ -428,7 +426,9 @@ var ReactCompositeComponentMixin = assign({},
_processContext: function(context) {
var maskedContext = null;
var contextTypes = this._instance.constructor.contextTypes;
if (!contextTypes) return emptyObject;
if (!contextTypes) {
return emptyObject;
}
maskedContext = {};
for (var contextName in contextTypes) {
maskedContext[contextName] = context[contextName];
Expand Down
4 changes: 0 additions & 4 deletions src/core/ReactPropTransferer.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@

var assign = require('Object.assign');
var emptyFunction = require('emptyFunction');
var invariant = require('invariant');
var joinClasses = require('joinClasses');
var warning = require('warning');

var didWarn = false;

/**
* Creates a transfer strategy that will merge prop values using the supplied
Expand Down
17 changes: 5 additions & 12 deletions src/core/ReactRef.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
/**
* Copyright 2013-2014 Facebook, Inc.
* Copyright 2013-2014, Facebook, Inc.
* All rights reserved.
*
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, sorry.

* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* 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 ReactRef
*/
Expand Down
1 change: 0 additions & 1 deletion src/core/__tests__/ReactEmptyComponent-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,4 +232,3 @@ describe('ReactEmptyComponent', function() {
);
});
});

3 changes: 2 additions & 1 deletion src/core/instantiateReactComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ function instantiateReactComponent(node, parentCompositeType) {
} else {
invariant(
false,
'Encountered invalid React node of type ' + typeof node
'Encountered invalid React node of type %s',
typeof node
);
}

Expand Down
2 changes: 0 additions & 2 deletions src/core/shouldUpdateReactComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

"use strict";

var ReactNativeComponent = require('ReactNativeComponent');

/**
* Given a `prevElement` and `nextElement`, determines if the existing
* instance should be updated as opposed to being destroyed or replaced by a new
Expand Down
1 change: 0 additions & 1 deletion src/test/ReactTestUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ var ReactUpdates = require('ReactUpdates');
var SyntheticEvent = require('SyntheticEvent');

var assign = require('Object.assign');
var instantiateReactComponent = require('instantiateReactComponent');

var topLevelTypes = EventConstants.topLevelTypes;

Expand Down