mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
@@ -14,7 +14,6 @@
|
||||
var React = require('React');
|
||||
var ReactDOM = require('ReactDOM');
|
||||
var ReactTestUtils = require('ReactTestUtils');
|
||||
var div = React.createFactory('div');
|
||||
|
||||
describe('ReactDOM', () => {
|
||||
// TODO: uncomment this test once we can run in phantom, which
|
||||
@@ -54,7 +53,7 @@ describe('ReactDOM', () => {
|
||||
|
||||
it('should allow children to be passed as an argument', () => {
|
||||
var argDiv = ReactTestUtils.renderIntoDocument(
|
||||
div(null, 'child')
|
||||
React.DOM.div(null, 'child')
|
||||
);
|
||||
var argNode = ReactDOM.findDOMNode(argDiv);
|
||||
expect(argNode.innerHTML).toBe('child');
|
||||
@@ -62,7 +61,7 @@ describe('ReactDOM', () => {
|
||||
|
||||
it('should overwrite props.children with children argument', () => {
|
||||
var conflictDiv = ReactTestUtils.renderIntoDocument(
|
||||
div({children: 'fakechild'}, 'child')
|
||||
React.DOM.div({children: 'fakechild'}, 'child')
|
||||
);
|
||||
var conflictNode = ReactDOM.findDOMNode(conflictDiv);
|
||||
expect(conflictNode.innerHTML).toBe('child');
|
||||
|
||||
@@ -157,22 +157,13 @@ var NoopRenderer = ReactFiberReconciler({
|
||||
},
|
||||
|
||||
prepareForCommit() : void {
|
||||
if (isCommitting) {
|
||||
throw new Error('Double prepare before commit');
|
||||
}
|
||||
isCommitting = true;
|
||||
},
|
||||
|
||||
resetAfterCommit() : void {
|
||||
if (!isCommitting) {
|
||||
throw new Error('Double reset after commit');
|
||||
}
|
||||
isCommitting = false;
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
var isCommitting = false;
|
||||
var rootContainers = new Map();
|
||||
var roots = new Map();
|
||||
var DEFAULT_ROOT_ID = '<default>';
|
||||
@@ -270,8 +261,6 @@ var ReactNoop = {
|
||||
|
||||
syncUpdates: NoopRenderer.syncUpdates,
|
||||
|
||||
isCommitting: () => isCommitting,
|
||||
|
||||
// Logs the current state of the tree.
|
||||
dumpTree(rootID : string = DEFAULT_ROOT_ID) {
|
||||
const root = roots.get(rootID);
|
||||
|
||||
@@ -88,10 +88,6 @@ module.exports = function<T, P, I, TI, C>(config : HostConfig<T, P, I, TI, C>) {
|
||||
// Need this to prevent recursion while in a Task loop.
|
||||
let isPerformingTaskWork : boolean = false;
|
||||
|
||||
// We'll only prepare/reset on the outermost commit even when a setState
|
||||
// callback causes another synchronous rerender
|
||||
let isCommitting : boolean = false;
|
||||
|
||||
// The next work in progress fiber that we're currently working on.
|
||||
let nextUnitOfWork : ?Fiber = null;
|
||||
let nextPriorityLevel : PriorityLevel = NoWork;
|
||||
|
||||
Reference in New Issue
Block a user