);
// Warm the cache with theDog
myDiv.setProps({
children: {
- theDog: ,
- theBird:
+ theDog: ,
+ theBird:
}
});
// Remove theDog - this should purge the cache
myDiv.setProps({
children: {
- theBird:
+ theBird:
}
});
// Now, put theDog back. It's now a different DOM node.
myDiv.setProps({
children: {
- theDog: ,
- theBird:
+ theDog: ,
+ theBird:
}
});
- // Change the className of theDog. It will use the same element
+ // Change the class of theDog. It will use the same element
myDiv.setProps({
children: {
- theDog: ,
- theBird:
+ theDog: ,
+ theBird:
}
});
var root = ReactMount.getNode(myDiv._rootNodeID);
diff --git a/src/core/__tests__/ReactDOMComponent-test.js b/src/core/__tests__/ReactDOMComponent-test.js
index de94aa62a83d..7cd82054990f 100644
--- a/src/core/__tests__/ReactDOMComponent-test.js
+++ b/src/core/__tests__/ReactDOMComponent-test.js
@@ -38,14 +38,14 @@ describe('ReactDOMComponent', function() {
transaction = new ReactReconcileTransaction();
});
- it("should handle className", function() {
+ it("should handle class", function() {
var stub = ReactTestUtils.renderIntoDocument();
- stub.receiveComponent({props: { className: 'foo' }}, transaction);
+ stub.receiveComponent({props: { class: 'foo' }}, transaction);
expect(stub.getDOMNode().className).toEqual('foo');
- stub.receiveComponent({props: { className: 'bar' }}, transaction);
+ stub.receiveComponent({props: { class: 'bar' }}, transaction);
expect(stub.getDOMNode().className).toEqual('bar');
- stub.receiveComponent({props: { className: null }}, transaction);
+ stub.receiveComponent({props: { class: null }}, transaction);
expect(stub.getDOMNode().className).toEqual('');
});
@@ -120,7 +120,7 @@ describe('ReactDOMComponent', function() {
});
it("should remove properties", function() {
- var stub = ReactTestUtils.renderIntoDocument();
+ var stub = ReactTestUtils.renderIntoDocument();
expect(stub.getDOMNode().className).toEqual('monkey');
stub.receiveComponent({props: {}}, transaction);
@@ -247,10 +247,10 @@ describe('ReactDOMComponent', function() {
});
});
- it("should generate the correct markup with className", function() {
- expect(genMarkup({ className: 'a' })).toHaveAttribute('class', 'a');
- expect(genMarkup({ className: 'a b' })).toHaveAttribute('class', 'a b');
- expect(genMarkup({ className: '' })).toHaveAttribute('class', '');
+ it("should generate the correct markup with class", function() {
+ expect(genMarkup({ class: 'a' })).toHaveAttribute('class', 'a');
+ expect(genMarkup({ class: 'a b' })).toHaveAttribute('class', 'a b');
+ expect(genMarkup({ class: '' })).toHaveAttribute('class', '');
});
});
diff --git a/src/core/__tests__/ReactPropTransferer-test.js b/src/core/__tests__/ReactPropTransferer-test.js
index b840b56352a8..3d0b2797353c 100644
--- a/src/core/__tests__/ReactPropTransferer-test.js
+++ b/src/core/__tests__/ReactPropTransferer-test.js
@@ -36,7 +36,7 @@ describe('ReactPropTransferer', function() {
render: function() {
return this.transferPropsTo(
;
ReactTestUtils.renderIntoDocument(instance);
@@ -83,7 +83,7 @@ describe('ReactPropTransferer', function() {
.expectRenderedChild()
.toBeComponentOfType(React.DOM.input)
.scalarPropsEqual({
- className: 'textinput hidden_elem',
+ class: 'textinput hidden_elem',
style: {
display: 'block',
width: '100%'
diff --git a/src/core/__tests__/refs-test.js b/src/core/__tests__/refs-test.js
index ab52347a9755..13092be2dac3 100644
--- a/src/core/__tests__/refs-test.js
+++ b/src/core/__tests__/refs-test.js
@@ -45,14 +45,14 @@ var ClickCounter = React.createClass({
for (i=0; i < this.state.count; i++) {
children.push(
);
}
return (
-
+
{children}
);
@@ -187,15 +187,15 @@ describe('ref swapping', function() {
return (
diff --git a/src/test/ReactTestUtils.js b/src/test/ReactTestUtils.js
index 8d34272703b1..d3482910ee9b 100644
--- a/src/test/ReactTestUtils.js
+++ b/src/test/ReactTestUtils.js
@@ -120,12 +120,12 @@ var ReactTestUtils = {
/**
* Finds all instance of components in the rendered tree that are DOM
- * components with the class name matching `className`.
+ * components with the class name matching `class`.
* @return an array of all the matches.
*/
scryRenderedDOMComponentsWithClass: function(root, className) {
return ReactTestUtils.findAllInRenderedTree(root, function(inst) {
- var instClassName = inst.props.className;
+ var instClassName = inst.props.class;
return ReactTestUtils.isDOMComponent(inst) && (
instClassName &&
(' ' + instClassName + ' ').indexOf(' ' + className + ' ') !== -1
diff --git a/src/utils/__tests__/cloneWithProps-test.js b/src/utils/__tests__/cloneWithProps-test.js
index a68ed4e4968c..93d72ad864db 100644
--- a/src/utils/__tests__/cloneWithProps-test.js
+++ b/src/utils/__tests__/cloneWithProps-test.js
@@ -45,14 +45,14 @@ describe('cloneWithProps', function() {
it('should clone a DOM component with new props', function() {
var Grandparent = React.createClass({
render: function() {
- return ;
+ return ;
}
});
var Parent = React.createClass({
render: function() {
return (
-