Skip to content

Instantly share code, notes, and snippets.

@vjeux
Created January 16, 2017 02:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vjeux/2eeac7e9890c3c3a232bbe366d33523e to your computer and use it in GitHub Desktop.
Save vjeux/2eeac7e9890c3c3a232bbe366d33523e to your computer and use it in GitHub Desktop.
Index: ../react/src/isomorphic/children/__tests__/ReactChildren-test.js
===================================================================
--- ../react/src/isomorphic/children/__tests__/ReactChildren-test.js
+++ ../react/src/isomorphic/children/__tests__/ReactChildren-test.js
@@ -206,12 +206,12 @@
<div>
{
- [
- ReactFragment.create({
- firstHalfKey: [ zero, one, two ],
- secondHalfKey: [ three, four ],
- keyFive: five
- })
- ]
- }
+ [
+ ReactFragment.create({
+ firstHalfKey: [ zero, one, two ],
+ secondHalfKey: [ three, four ],
+ keyFive: five
+ })
+ ]
+ }
</div>
);
@@ -866,13 +866,13 @@
<div>
{
- [
- ReactFragment.create({
- firstHalfKey: [ zero, one, two ],
- secondHalfKey: [ three, four ],
- keyFive: five
- }),
- null
- ]
- }
+ [
+ ReactFragment.create({
+ firstHalfKey: [ zero, one, two ],
+ secondHalfKey: [ three, four ],
+ keyFive: five
+ }),
+ null
+ ]
+ }
</div>
);
Index: ../react/src/isomorphic/hooks/ReactComponentTreeHook.js
===================================================================
--- ../react/src/isomorphic/hooks/ReactComponentTreeHook.js
+++ ../react/src/isomorphic/hooks/ReactComponentTreeHook.js
@@ -34,7 +34,11 @@
var reIsNative = RegExp(
"^" + // Take an example native function source for comparison
- funcToString.call(
- hasOwnProperty
- ).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
+ funcToString
+ .call(hasOwnProperty)
+ .replace(/[\\^$.*+?()[\]{}|]/g, "\\$&")
+ .replace(
+ /hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,
+ "$1.*?"
+ ) + "$"
);
try {
Index: ../react/src/renderers/native/findNodeHandle.js
===================================================================
--- ../react/src/renderers/native/findNodeHandle.js
+++ ../react/src/renderers/native/findNodeHandle.js
@@ -94,5 +94,6 @@
("_rootNodeID" in component ||
// TODO (bvaughn) Clean up once Stack is deprecated
- "_nativeTag" in component) || // Composite
+ "_nativeTag" in component) ||
+ // Composite
component.render != null && typeof component.render === "function",
"findNodeHandle(...): Argument is not a component " +
Index: ../react/src/renderers/shared/shared/event/eventPlugins/ResponderEventPlugin.js
===================================================================
--- ../react/src/renderers/shared/shared/event/eventPlugins/ResponderEventPlugin.js
+++ ../react/src/renderers/shared/shared/event/eventPlugins/ResponderEventPlugin.js
@@ -413,8 +413,8 @@
*/
function canTriggerTransfer(topLevelType, topLevelInst, nativeEvent) {
- return topLevelInst &&
- // responderIgnoreScroll: We are trying to migrate away from specifically
- // tracking native scroll events here and responderIgnoreScroll indicates we
- // will send topTouchCancel to handle canceling touch events instead
+ return // responderIgnoreScroll: We are trying to migrate away from specifically
+ // tracking native scroll events here and responderIgnoreScroll indicates we
+ // will send topTouchCancel to handle canceling touch events instead
+ topLevelInst &&
(topLevelType === "topScroll" && !nativeEvent.responderIgnoreScroll ||
trackedTouchCount > 0 && topLevelType === "topSelectionChange" ||
Index: ../react/src/renderers/shared/stack/reconciler/ReactRef.js
===================================================================
--- ../react/src/renderers/shared/stack/reconciler/ReactRef.js
+++ ../react/src/renderers/shared/stack/reconciler/ReactRef.js
@@ -120,7 +120,7 @@
}
- return // If owner changes but we have an unchanged function ref, don't update refs
- prevRef !== nextRef ||
- typeof nextRef === "string" && nextOwner !== prevOwner;
+ return;
+ // If owner changes but we have an unchanged function ref, don't update refs
+ prevRef !== nextRef || typeof nextRef === "string" && nextOwner !== prevOwner;
};
Index: ../react/src/shared/utils/traverseAllChildren.js
===================================================================
--- ../react/src/shared/utils/traverseAllChildren.js
+++ ../react/src/shared/utils/traverseAllChildren.js
@@ -73,7 +73,6 @@
if (// The following is inlined from ReactElement. This means we can optimize
// some checks. React Fiber also inlines this logic for similar purposes.
- children === null || type === "string" ||
- type ===
- "number" || type === "object" && children.$$typeof === REACT_ELEMENT_TYPE) {
+ children === null || type === "string" || type === "number" ||
+ type === "object" && children.$$typeof === REACT_ELEMENT_TYPE) {
callback(
traverseContext,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment