Fix lint errors (#8113)

This commit is contained in:
Ivan Zotov 2016-10-27 15:03:32 +03:00 committed by Dan Abramov
parent 603b7194dc
commit 6fec6507ed
3 changed files with 25 additions and 8 deletions

View File

@ -96,7 +96,11 @@ var DOMRenderer = ReactFiberReconciler({
parentInstance.appendChild(child);
},
insertBefore(parentInstance : Instance, child : Instance | TextInstance, beforeChild : Instance | TextInstance) : void {
insertBefore(
parentInstance : Instance,
child : Instance | TextInstance,
beforeChild : Instance | TextInstance
) : void {
parentInstance.insertBefore(child, beforeChild);
},

View File

@ -41,7 +41,10 @@ type TextInstance = { tag: 98, text: string };
var instanceCounter = 0;
function recursivelyAppendChildren(flatArray : Array<Instance | TextInstance>, child : HostChildren<Instance | TextInstance>) {
function recursivelyAppendChildren(
flatArray : Array<Instance | TextInstance>,
child : HostChildren<Instance | TextInstance>
) {
if (!child) {
return;
}
@ -108,7 +111,11 @@ var NoopRenderer = ReactFiberReconciler({
parentInstance.children.push(child);
},
insertBefore(parentInstance : Instance, child : Instance | TextInstance, beforeChild : Instance | TextInstance) : void {
insertBefore(
parentInstance : Instance,
child : Instance | TextInstance,
beforeChild : Instance | TextInstance
) : void {
const index = parentInstance.children.indexOf(child);
if (index !== -1) {
parentInstance.children.splice(index, 1);

View File

@ -46,7 +46,10 @@ var {
} = require('ReactTypeOfSideEffect');
var ReactFiberClassComponent = require('ReactFiberClassComponent');
module.exports = function<T, P, I, TI, C>(config : HostConfig<T, P, I, TI, C>, scheduleUpdate : (fiber: Fiber, priorityLevel : PriorityLevel) => void) {
module.exports = function<T, P, I, TI, C>(
config : HostConfig<T, P, I, TI, C>,
scheduleUpdate : (fiber: Fiber, priorityLevel : PriorityLevel) => void
) {
const {
adoptClassInstance,
@ -152,11 +155,13 @@ module.exports = function<T, P, I, TI, C>(config : HostConfig<T, P, I, TI, C>, s
}
}
var nextChildren;
if (__DEV__) {
ReactCurrentOwner.current = workInProgress;
var nextChildren = fn(props);
nextChildren = fn(props);
} else {
var nextChildren = fn(props);
nextChildren = fn(props);
}
reconcileChildren(current, workInProgress, nextChildren);
return workInProgress.child;
@ -244,12 +249,13 @@ module.exports = function<T, P, I, TI, C>(config : HostConfig<T, P, I, TI, C>, s
}
var fn = workInProgress.type;
var props = workInProgress.pendingProps;
var value;
if (__DEV__) {
ReactCurrentOwner.current = workInProgress;
var value = fn(props);
value = fn(props);
} else {
var value = fn(props);
value = fn(props);
}
if (typeof value === 'object' && value && typeof value.render === 'function') {