Skip to content

Commit

Permalink
Flip useTransition tuple
Browse files Browse the repository at this point in the history
Summary:
This diff flips the order of the tuple returned by useTransition.

See here for more info: facebook/react#20976

Changelog: internal

Reviewed By: gaearon

Differential Revision: D27928490

fbshipit-source-id: a1896f92ef24382012fa3be1ef043752e62b21e7
  • Loading branch information
rickhanlonii authored and facebook-github-bot committed Apr 22, 2021
1 parent 2c34946 commit 96930fa
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 33 deletions.
2 changes: 1 addition & 1 deletion Libraries/Renderer/REVISION
@@ -1 +1 @@
bd7f4a013be3ef272a01874532bee71ad861e617
a632f7de3bd35eaf6d5082054af4da92dd37cf20
8 changes: 4 additions & 4 deletions Libraries/Renderer/implementations/ReactFabric-dev.fb.js
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<2ebb47c89a60a8b3e667fdf7431261b6>>
* @generated SignedSource<<85633cd599819668a18b16a0756284c2>>
*/

'use strict';
Expand Down Expand Up @@ -11173,7 +11173,7 @@ function mountTransition() {
var start = startTransition.bind(null, setPending);
var hook = mountWorkInProgressHook();
hook.memoizedState = start;
return [start, isPending];
return [isPending, start];
}

function updateTransition() {
Expand All @@ -11182,7 +11182,7 @@ function updateTransition() {

var hook = updateWorkInProgressHook();
var start = hook.memoizedState;
return [start, isPending];
return [isPending, start];
}

function rerenderTransition() {
Expand All @@ -11191,7 +11191,7 @@ function rerenderTransition() {

var hook = updateWorkInProgressHook();
var start = hook.memoizedState;
return [start, isPending];
return [isPending, start];
}

var isUpdatingOpaqueValueInRenderPhase = false;
Expand Down
14 changes: 8 additions & 6 deletions Libraries/Renderer/implementations/ReactFabric-prod.fb.js
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<f41656c617fa40163bc178f355249017>>
* @generated SignedSource<<9877a9ca3ef854c84fe796f0864c7089>>
*/

"use strict";
Expand Down Expand Up @@ -3897,7 +3897,7 @@ var ContextOnlyDispatcher = {
isPending = _mountState2[0];
_mountState2 = startTransition.bind(null, _mountState2[1]);
mountWorkInProgressHook().memoizedState = _mountState2;
return [_mountState2, isPending];
return [isPending, _mountState2];
},
useMutableSource: function(source, getSnapshot, subscribe) {
var hook = mountWorkInProgressHook();
Expand Down Expand Up @@ -3946,8 +3946,9 @@ var ContextOnlyDispatcher = {
return prevValue;
},
useTransition: function() {
var isPending = updateReducer(basicStateReducer)[0];
return [updateWorkInProgressHook().memoizedState, isPending];
var isPending = updateReducer(basicStateReducer)[0],
start = updateWorkInProgressHook().memoizedState;
return [isPending, start];
},
useMutableSource: updateMutableSource,
useOpaqueIdentifier: function() {
Expand Down Expand Up @@ -3988,8 +3989,9 @@ var ContextOnlyDispatcher = {
return prevValue;
},
useTransition: function() {
var isPending = rerenderReducer(basicStateReducer)[0];
return [updateWorkInProgressHook().memoizedState, isPending];
var isPending = rerenderReducer(basicStateReducer)[0],
start = updateWorkInProgressHook().memoizedState;
return [isPending, start];
},
useMutableSource: updateMutableSource,
useOpaqueIdentifier: function() {
Expand Down
14 changes: 8 additions & 6 deletions Libraries/Renderer/implementations/ReactFabric-profiling.fb.js
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<f4d536820af3da737ebc471060e63f42>>
* @generated SignedSource<<7da8cf3208220ac6e1e05d089bd22e17>>
*/

"use strict";
Expand Down Expand Up @@ -3923,7 +3923,7 @@ var ContextOnlyDispatcher = {
isPending = _mountState2[0];
_mountState2 = startTransition.bind(null, _mountState2[1]);
mountWorkInProgressHook().memoizedState = _mountState2;
return [_mountState2, isPending];
return [isPending, _mountState2];
},
useMutableSource: function(source, getSnapshot, subscribe) {
var hook = mountWorkInProgressHook();
Expand Down Expand Up @@ -3972,8 +3972,9 @@ var ContextOnlyDispatcher = {
return prevValue;
},
useTransition: function() {
var isPending = updateReducer(basicStateReducer)[0];
return [updateWorkInProgressHook().memoizedState, isPending];
var isPending = updateReducer(basicStateReducer)[0],
start = updateWorkInProgressHook().memoizedState;
return [isPending, start];
},
useMutableSource: updateMutableSource,
useOpaqueIdentifier: function() {
Expand Down Expand Up @@ -4014,8 +4015,9 @@ var ContextOnlyDispatcher = {
return prevValue;
},
useTransition: function() {
var isPending = rerenderReducer(basicStateReducer)[0];
return [updateWorkInProgressHook().memoizedState, isPending];
var isPending = rerenderReducer(basicStateReducer)[0],
start = updateWorkInProgressHook().memoizedState;
return [isPending, start];
},
useMutableSource: updateMutableSource,
useOpaqueIdentifier: function() {
Expand Down
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<5f437c4c1fcda37e2bb8dab0d04f1431>>
* @generated SignedSource<<5646d53ee7f4f50af19833b5e7a7253c>>
*/

'use strict';
Expand Down Expand Up @@ -11492,7 +11492,7 @@ function mountTransition() {
var start = startTransition.bind(null, setPending);
var hook = mountWorkInProgressHook();
hook.memoizedState = start;
return [start, isPending];
return [isPending, start];
}

function updateTransition() {
Expand All @@ -11501,7 +11501,7 @@ function updateTransition() {

var hook = updateWorkInProgressHook();
var start = hook.memoizedState;
return [start, isPending];
return [isPending, start];
}

function rerenderTransition() {
Expand All @@ -11510,7 +11510,7 @@ function rerenderTransition() {

var hook = updateWorkInProgressHook();
var start = hook.memoizedState;
return [start, isPending];
return [isPending, start];
}

var isUpdatingOpaqueValueInRenderPhase = false;
Expand Down
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<ea82815c6b2135bf145c1c5895967692>>
* @generated SignedSource<<7fe4adbce18b530534dc96bc573966a5>>
*/

"use strict";
Expand Down Expand Up @@ -3933,7 +3933,7 @@ var ContextOnlyDispatcher = {
isPending = _mountState2[0];
_mountState2 = startTransition.bind(null, _mountState2[1]);
mountWorkInProgressHook().memoizedState = _mountState2;
return [_mountState2, isPending];
return [isPending, _mountState2];
},
useMutableSource: function(source, getSnapshot, subscribe) {
var hook = mountWorkInProgressHook();
Expand Down Expand Up @@ -3982,8 +3982,9 @@ var ContextOnlyDispatcher = {
return prevValue;
},
useTransition: function() {
var isPending = updateReducer(basicStateReducer)[0];
return [updateWorkInProgressHook().memoizedState, isPending];
var isPending = updateReducer(basicStateReducer)[0],
start = updateWorkInProgressHook().memoizedState;
return [isPending, start];
},
useMutableSource: updateMutableSource,
useOpaqueIdentifier: function() {
Expand Down Expand Up @@ -4024,8 +4025,9 @@ var ContextOnlyDispatcher = {
return prevValue;
},
useTransition: function() {
var isPending = rerenderReducer(basicStateReducer)[0];
return [updateWorkInProgressHook().memoizedState, isPending];
var isPending = rerenderReducer(basicStateReducer)[0],
start = updateWorkInProgressHook().memoizedState;
return [isPending, start];
},
useMutableSource: updateMutableSource,
useOpaqueIdentifier: function() {
Expand Down
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<f3ba739eb1c9f66a84cff47bff41d5c4>>
* @generated SignedSource<<feadd8235d80907d50c4c6a1249e0c85>>
*/

"use strict";
Expand Down Expand Up @@ -3959,7 +3959,7 @@ var ContextOnlyDispatcher = {
isPending = _mountState2[0];
_mountState2 = startTransition.bind(null, _mountState2[1]);
mountWorkInProgressHook().memoizedState = _mountState2;
return [_mountState2, isPending];
return [isPending, _mountState2];
},
useMutableSource: function(source, getSnapshot, subscribe) {
var hook = mountWorkInProgressHook();
Expand Down Expand Up @@ -4008,8 +4008,9 @@ var ContextOnlyDispatcher = {
return prevValue;
},
useTransition: function() {
var isPending = updateReducer(basicStateReducer)[0];
return [updateWorkInProgressHook().memoizedState, isPending];
var isPending = updateReducer(basicStateReducer)[0],
start = updateWorkInProgressHook().memoizedState;
return [isPending, start];
},
useMutableSource: updateMutableSource,
useOpaqueIdentifier: function() {
Expand Down Expand Up @@ -4050,8 +4051,9 @@ var ContextOnlyDispatcher = {
return prevValue;
},
useTransition: function() {
var isPending = rerenderReducer(basicStateReducer)[0];
return [updateWorkInProgressHook().memoizedState, isPending];
var isPending = rerenderReducer(basicStateReducer)[0],
start = updateWorkInProgressHook().memoizedState;
return [isPending, start];
},
useMutableSource: updateMutableSource,
useOpaqueIdentifier: function() {
Expand Down

0 comments on commit 96930fa

Please sign in to comment.