Skip to content

Commit 96930fa

Browse files
rickhanloniifacebook-github-bot
authored andcommitted
Flip useTransition tuple
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
1 parent 2c34946 commit 96930fa

File tree

7 files changed

+41
-33
lines changed

7 files changed

+41
-33
lines changed

Libraries/Renderer/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
bd7f4a013be3ef272a01874532bee71ad861e617
1+
a632f7de3bd35eaf6d5082054af4da92dd37cf20

Libraries/Renderer/implementations/ReactFabric-dev.fb.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<2ebb47c89a60a8b3e667fdf7431261b6>>
10+
* @generated SignedSource<<85633cd599819668a18b16a0756284c2>>
1111
*/
1212

1313
'use strict';
@@ -11173,7 +11173,7 @@ function mountTransition() {
1117311173
var start = startTransition.bind(null, setPending);
1117411174
var hook = mountWorkInProgressHook();
1117511175
hook.memoizedState = start;
11176-
return [start, isPending];
11176+
return [isPending, start];
1117711177
}
1117811178

1117911179
function updateTransition() {
@@ -11182,7 +11182,7 @@ function updateTransition() {
1118211182

1118311183
var hook = updateWorkInProgressHook();
1118411184
var start = hook.memoizedState;
11185-
return [start, isPending];
11185+
return [isPending, start];
1118611186
}
1118711187

1118811188
function rerenderTransition() {
@@ -11191,7 +11191,7 @@ function rerenderTransition() {
1119111191

1119211192
var hook = updateWorkInProgressHook();
1119311193
var start = hook.memoizedState;
11194-
return [start, isPending];
11194+
return [isPending, start];
1119511195
}
1119611196

1119711197
var isUpdatingOpaqueValueInRenderPhase = false;

Libraries/Renderer/implementations/ReactFabric-prod.fb.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<f41656c617fa40163bc178f355249017>>
10+
* @generated SignedSource<<9877a9ca3ef854c84fe796f0864c7089>>
1111
*/
1212

1313
"use strict";
@@ -3897,7 +3897,7 @@ var ContextOnlyDispatcher = {
38973897
isPending = _mountState2[0];
38983898
_mountState2 = startTransition.bind(null, _mountState2[1]);
38993899
mountWorkInProgressHook().memoizedState = _mountState2;
3900-
return [_mountState2, isPending];
3900+
return [isPending, _mountState2];
39013901
},
39023902
useMutableSource: function(source, getSnapshot, subscribe) {
39033903
var hook = mountWorkInProgressHook();
@@ -3946,8 +3946,9 @@ var ContextOnlyDispatcher = {
39463946
return prevValue;
39473947
},
39483948
useTransition: function() {
3949-
var isPending = updateReducer(basicStateReducer)[0];
3950-
return [updateWorkInProgressHook().memoizedState, isPending];
3949+
var isPending = updateReducer(basicStateReducer)[0],
3950+
start = updateWorkInProgressHook().memoizedState;
3951+
return [isPending, start];
39513952
},
39523953
useMutableSource: updateMutableSource,
39533954
useOpaqueIdentifier: function() {
@@ -3988,8 +3989,9 @@ var ContextOnlyDispatcher = {
39883989
return prevValue;
39893990
},
39903991
useTransition: function() {
3991-
var isPending = rerenderReducer(basicStateReducer)[0];
3992-
return [updateWorkInProgressHook().memoizedState, isPending];
3992+
var isPending = rerenderReducer(basicStateReducer)[0],
3993+
start = updateWorkInProgressHook().memoizedState;
3994+
return [isPending, start];
39933995
},
39943996
useMutableSource: updateMutableSource,
39953997
useOpaqueIdentifier: function() {

Libraries/Renderer/implementations/ReactFabric-profiling.fb.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<f4d536820af3da737ebc471060e63f42>>
10+
* @generated SignedSource<<7da8cf3208220ac6e1e05d089bd22e17>>
1111
*/
1212

1313
"use strict";
@@ -3923,7 +3923,7 @@ var ContextOnlyDispatcher = {
39233923
isPending = _mountState2[0];
39243924
_mountState2 = startTransition.bind(null, _mountState2[1]);
39253925
mountWorkInProgressHook().memoizedState = _mountState2;
3926-
return [_mountState2, isPending];
3926+
return [isPending, _mountState2];
39273927
},
39283928
useMutableSource: function(source, getSnapshot, subscribe) {
39293929
var hook = mountWorkInProgressHook();
@@ -3972,8 +3972,9 @@ var ContextOnlyDispatcher = {
39723972
return prevValue;
39733973
},
39743974
useTransition: function() {
3975-
var isPending = updateReducer(basicStateReducer)[0];
3976-
return [updateWorkInProgressHook().memoizedState, isPending];
3975+
var isPending = updateReducer(basicStateReducer)[0],
3976+
start = updateWorkInProgressHook().memoizedState;
3977+
return [isPending, start];
39773978
},
39783979
useMutableSource: updateMutableSource,
39793980
useOpaqueIdentifier: function() {
@@ -4014,8 +4015,9 @@ var ContextOnlyDispatcher = {
40144015
return prevValue;
40154016
},
40164017
useTransition: function() {
4017-
var isPending = rerenderReducer(basicStateReducer)[0];
4018-
return [updateWorkInProgressHook().memoizedState, isPending];
4018+
var isPending = rerenderReducer(basicStateReducer)[0],
4019+
start = updateWorkInProgressHook().memoizedState;
4020+
return [isPending, start];
40194021
},
40204022
useMutableSource: updateMutableSource,
40214023
useOpaqueIdentifier: function() {

Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<5f437c4c1fcda37e2bb8dab0d04f1431>>
10+
* @generated SignedSource<<5646d53ee7f4f50af19833b5e7a7253c>>
1111
*/
1212

1313
'use strict';
@@ -11492,7 +11492,7 @@ function mountTransition() {
1149211492
var start = startTransition.bind(null, setPending);
1149311493
var hook = mountWorkInProgressHook();
1149411494
hook.memoizedState = start;
11495-
return [start, isPending];
11495+
return [isPending, start];
1149611496
}
1149711497

1149811498
function updateTransition() {
@@ -11501,7 +11501,7 @@ function updateTransition() {
1150111501

1150211502
var hook = updateWorkInProgressHook();
1150311503
var start = hook.memoizedState;
11504-
return [start, isPending];
11504+
return [isPending, start];
1150511505
}
1150611506

1150711507
function rerenderTransition() {
@@ -11510,7 +11510,7 @@ function rerenderTransition() {
1151011510

1151111511
var hook = updateWorkInProgressHook();
1151211512
var start = hook.memoizedState;
11513-
return [start, isPending];
11513+
return [isPending, start];
1151411514
}
1151511515

1151611516
var isUpdatingOpaqueValueInRenderPhase = false;

Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<ea82815c6b2135bf145c1c5895967692>>
10+
* @generated SignedSource<<7fe4adbce18b530534dc96bc573966a5>>
1111
*/
1212

1313
"use strict";
@@ -3933,7 +3933,7 @@ var ContextOnlyDispatcher = {
39333933
isPending = _mountState2[0];
39343934
_mountState2 = startTransition.bind(null, _mountState2[1]);
39353935
mountWorkInProgressHook().memoizedState = _mountState2;
3936-
return [_mountState2, isPending];
3936+
return [isPending, _mountState2];
39373937
},
39383938
useMutableSource: function(source, getSnapshot, subscribe) {
39393939
var hook = mountWorkInProgressHook();
@@ -3982,8 +3982,9 @@ var ContextOnlyDispatcher = {
39823982
return prevValue;
39833983
},
39843984
useTransition: function() {
3985-
var isPending = updateReducer(basicStateReducer)[0];
3986-
return [updateWorkInProgressHook().memoizedState, isPending];
3985+
var isPending = updateReducer(basicStateReducer)[0],
3986+
start = updateWorkInProgressHook().memoizedState;
3987+
return [isPending, start];
39873988
},
39883989
useMutableSource: updateMutableSource,
39893990
useOpaqueIdentifier: function() {
@@ -4024,8 +4025,9 @@ var ContextOnlyDispatcher = {
40244025
return prevValue;
40254026
},
40264027
useTransition: function() {
4027-
var isPending = rerenderReducer(basicStateReducer)[0];
4028-
return [updateWorkInProgressHook().memoizedState, isPending];
4028+
var isPending = rerenderReducer(basicStateReducer)[0],
4029+
start = updateWorkInProgressHook().memoizedState;
4030+
return [isPending, start];
40294031
},
40304032
useMutableSource: updateMutableSource,
40314033
useOpaqueIdentifier: function() {

Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<f3ba739eb1c9f66a84cff47bff41d5c4>>
10+
* @generated SignedSource<<feadd8235d80907d50c4c6a1249e0c85>>
1111
*/
1212

1313
"use strict";
@@ -3959,7 +3959,7 @@ var ContextOnlyDispatcher = {
39593959
isPending = _mountState2[0];
39603960
_mountState2 = startTransition.bind(null, _mountState2[1]);
39613961
mountWorkInProgressHook().memoizedState = _mountState2;
3962-
return [_mountState2, isPending];
3962+
return [isPending, _mountState2];
39633963
},
39643964
useMutableSource: function(source, getSnapshot, subscribe) {
39653965
var hook = mountWorkInProgressHook();
@@ -4008,8 +4008,9 @@ var ContextOnlyDispatcher = {
40084008
return prevValue;
40094009
},
40104010
useTransition: function() {
4011-
var isPending = updateReducer(basicStateReducer)[0];
4012-
return [updateWorkInProgressHook().memoizedState, isPending];
4011+
var isPending = updateReducer(basicStateReducer)[0],
4012+
start = updateWorkInProgressHook().memoizedState;
4013+
return [isPending, start];
40134014
},
40144015
useMutableSource: updateMutableSource,
40154016
useOpaqueIdentifier: function() {
@@ -4050,8 +4051,9 @@ var ContextOnlyDispatcher = {
40504051
return prevValue;
40514052
},
40524053
useTransition: function() {
4053-
var isPending = rerenderReducer(basicStateReducer)[0];
4054-
return [updateWorkInProgressHook().memoizedState, isPending];
4054+
var isPending = rerenderReducer(basicStateReducer)[0],
4055+
start = updateWorkInProgressHook().memoizedState;
4056+
return [isPending, start];
40554057
},
40564058
useMutableSource: updateMutableSource,
40574059
useOpaqueIdentifier: function() {

0 commit comments

Comments
 (0)