Skip to content

Commit fdf7a55

Browse files
authored
refactor: resurrect dispatchCommand (#23)
1 parent 753553b commit fdf7a55

2 files changed

Lines changed: 7 additions & 17 deletions

File tree

packages/react-native-reanimated/Common/cpp/reanimated/RuntimeDecorators/UIRuntimeDecorator.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ void UIRuntimeDecorator::decorate(
2828
jsi_utils::installJsiFunction(uiRuntime, "_updatePropsFabric", updateProps);
2929
jsi_utils::installJsiFunction(
3030
uiRuntime, "_removeFromPropsRegistry", removeFromPropsRegistry);
31-
// jsi_utils::installJsiFunction(
32-
// uiRuntime, "_dispatchCommandFabric", dispatchCommand);
31+
jsi_utils::installJsiFunction(
32+
uiRuntime, "_dispatchCommandFabric", dispatchCommand);
3333
jsi_utils::installJsiFunction(uiRuntime, "_measureFabric", measure);
3434
#else
3535
jsi_utils::installJsiFunction(uiRuntime, "_updatePropsPaper", updateProps);
36-
// jsi_utils::installJsiFunction(
37-
// uiRuntime, "_dispatchCommandPaper", dispatchCommand);
36+
jsi_utils::installJsiFunction(
37+
uiRuntime, "_dispatchCommandPaper", dispatchCommand);
3838
jsi_utils::installJsiFunction(uiRuntime, "_scrollToPaper", scrollTo);
3939
jsi_utils::installJsiFunction(
4040
uiRuntime,

packages/react-native-reanimated/src/platformFunctions/dispatchCommand.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict';
2-
// import type { ShadowNodeWrapper } from '../commonTypes';
2+
import type { ShadowNodeWrapper } from '../commonTypes';
33
import {
44
isChromeDebugger,
55
isFabric,
@@ -36,39 +36,29 @@ export let dispatchCommand: DispatchCommand;
3636
function dispatchCommandFabric(
3737
animatedRef: AnimatedRefOnJS | AnimatedRefOnUI,
3838
commandName: string,
39-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
4039
args: Array<unknown> = []
4140
) {
42-
/* 'worklet';
41+
'worklet';
4342
if (!_WORKLET) {
4443
return;
4544
}
4645

4746
const shadowNodeWrapper = animatedRef() as ShadowNodeWrapper;
4847
global._dispatchCommandFabric!(shadowNodeWrapper, commandName, args);
49-
*/
50-
logger.warn(
51-
'dispatchCommand() is disabled: https://github.com/ExodusMovement/exodus-mobile/pull/24699. Contact AppSec if you need this.'
52-
);
5348
}
5449

5550
function dispatchCommandPaper(
5651
animatedRef: AnimatedRefOnJS | AnimatedRefOnUI,
5752
commandName: string,
58-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
5953
args: Array<unknown> = []
6054
) {
61-
/* 'worklet';
55+
'worklet';
6256
if (!_WORKLET) {
6357
return;
6458
}
6559

6660
const viewTag = animatedRef() as number;
6761
global._dispatchCommandPaper!(viewTag, commandName, args);
68-
*/
69-
logger.warn(
70-
'dispatchCommand() is disabled: https://github.com/ExodusMovement/exodus-mobile/pull/24699. Contact AppSec if you need this.'
71-
);
7262
}
7363

7464
function dispatchCommandJest() {

0 commit comments

Comments
 (0)