react-native-reanimated 3.4.0 → 3.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/module/reanimated2/core.js +16 -0
- package/lib/module/reanimated2/core.js.map +1 -1
- package/lib/module/reanimated2/platform-specific/jsVersion.js +1 -1
- package/lib/module/reanimated2/platform-specific/jsVersion.js.map +1 -1
- package/lib/typescript/reanimated2/core.d.ts +12 -0
- package/lib/typescript/reanimated2/platform-specific/jsVersion.d.ts +1 -1
- package/package.json +1 -1
- package/src/reanimated2/core.ts +16 -0
- package/src/reanimated2/platform-specific/jsVersion.ts +1 -1
|
@@ -7,6 +7,22 @@ export { startMapper, stopMapper } from './mappers';
|
|
|
7
7
|
export { runOnJS, runOnUI } from './threads';
|
|
8
8
|
export { makeShareable } from './shareables';
|
|
9
9
|
export { makeMutable, makeRemote } from './mutables';
|
|
10
|
+
/**
|
|
11
|
+
* @returns `true` in Reanimated 3, doesn't exist in Reanimated 2 or 1
|
|
12
|
+
*/
|
|
13
|
+
export const isReanimated3 = () => true;
|
|
14
|
+
|
|
15
|
+
// Superseded by check in `/src/threads.ts`.
|
|
16
|
+
// Used by `react-navigation` to detect if using Reanimated 2 or 3.
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated This function was superseded by other checks.
|
|
19
|
+
* We keep it here for backward compatibility reasons.
|
|
20
|
+
* If you need to check if you are using Reanimated 3 or Reanimated 2
|
|
21
|
+
* please use `isReanimated3` function instead.
|
|
22
|
+
* @returns `true` in Reanimated 3, doesn't exist in Reanimated 2
|
|
23
|
+
*/
|
|
24
|
+
export const isConfigured = isReanimated3;
|
|
25
|
+
|
|
10
26
|
// this is for web implementation
|
|
11
27
|
global._WORKLET = false;
|
|
12
28
|
global._log = function (s) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeReanimatedModule","nativeShouldBeMock","isWeb","makeShareableCloneRecursive","initializeUIRuntime","SensorContainer","startMapper","stopMapper","runOnJS","runOnUI","makeShareable","makeMutable","makeRemote","global","_WORKLET","_log","s","console","log","getViewProp","viewTag","propName","_IS_FABRIC","Error","Promise","resolve","reject","result","substr","getSensorContainer","__sensorContainer","registerEventHandler","eventHash","eventHandler","handleAndFlushAnimationFrame","eventTimestamp","event","__frameTimestamp","__flushAnimationFrame","undefined","unregisterEventHandler","id","subscribeForKeyboardEvents","options","state","height","now","performance","isStatusBarTranslucentAndroid","unsubscribeFromKeyboardEvents","listenerId","registerSensor","sensorType","config","sensorContainer","initializeSensor","unregisterSensor","sensorId","featuresConfig","enableLayoutAnimations","setByUser","flag","isCallByUser","arguments","length","configureLayoutAnimations","type","sharedTransitionTag","configureLayoutAnimation","configureProps","uiProps","nativeProps"],"sources":["core.ts"],"sourcesContent":["import NativeReanimatedModule from './NativeReanimated';\nimport { nativeShouldBeMock, isWeb } from './PlatformChecker';\nimport type {\n AnimatedKeyboardOptions,\n SensorConfig,\n SensorType,\n SharedValue,\n Value3D,\n ValueRotation,\n} from './commonTypes';\nimport { makeShareableCloneRecursive } from './shareables';\nimport type {\n LayoutAnimationFunction,\n LayoutAnimationType,\n} from './layoutReanimation';\nimport { initializeUIRuntime } from './initializers';\nimport type {\n ProgressAnimationCallback,\n SharedTransitionAnimationsFunction,\n} from './layoutReanimation/animationBuilder/commonTypes';\nimport { SensorContainer } from './SensorContainer';\n\nexport { startMapper, stopMapper } from './mappers';\nexport { runOnJS, runOnUI } from './threads';\nexport { makeShareable } from './shareables';\nexport { makeMutable, makeRemote } from './mutables';\n\nexport type ReanimatedConsole = Pick<\n Console,\n 'debug' | 'log' | 'warn' | 'info' | 'error'\n>;\n\n// this is for web implementation\nglobal._WORKLET = false;\nglobal._log = function (s: string) {\n console.log(s);\n};\n\nexport function getViewProp<T>(viewTag: string, propName: string): Promise<T> {\n if (global._IS_FABRIC) {\n throw new Error(\n '[react-native-reanimated] `getViewProp` is not supported on Fabric yet'\n );\n }\n\n return new Promise((resolve, reject) => {\n return NativeReanimatedModule.getViewProp(\n viewTag,\n propName,\n (result: T) => {\n if (typeof result === 'string' && result.substr(0, 6) === 'error:') {\n reject(result);\n } else {\n resolve(result);\n }\n }\n );\n });\n}\n\nexport function getSensorContainer(): SensorContainer {\n if (!global.__sensorContainer) {\n global.__sensorContainer = new SensorContainer();\n }\n return global.__sensorContainer;\n}\n\nexport function registerEventHandler<T>(\n eventHash: string,\n eventHandler: (event: T) => void\n): number {\n function handleAndFlushAnimationFrame(eventTimestamp: number, event: T) {\n 'worklet';\n global.__frameTimestamp = eventTimestamp;\n eventHandler(event);\n global.__flushAnimationFrame(eventTimestamp);\n global.__frameTimestamp = undefined;\n }\n return NativeReanimatedModule.registerEventHandler(\n eventHash,\n makeShareableCloneRecursive(handleAndFlushAnimationFrame)\n );\n}\n\nexport function unregisterEventHandler(id: number): void {\n return NativeReanimatedModule.unregisterEventHandler(id);\n}\n\nexport function subscribeForKeyboardEvents(\n eventHandler: (state: number, height: number) => void,\n options: AnimatedKeyboardOptions\n): number {\n // TODO: this should really go with the same code path as other events, that is\n // via registerEventHandler. For now we are copying the code from there.\n function handleAndFlushAnimationFrame(state: number, height: number) {\n 'worklet';\n const now = performance.now();\n global.__frameTimestamp = now;\n eventHandler(state, height);\n global.__flushAnimationFrame(now);\n global.__frameTimestamp = undefined;\n }\n return NativeReanimatedModule.subscribeForKeyboardEvents(\n makeShareableCloneRecursive(handleAndFlushAnimationFrame),\n options.isStatusBarTranslucentAndroid ?? false\n );\n}\n\nexport function unsubscribeFromKeyboardEvents(listenerId: number): void {\n return NativeReanimatedModule.unsubscribeFromKeyboardEvents(listenerId);\n}\n\nexport function registerSensor(\n sensorType: SensorType,\n config: SensorConfig,\n eventHandler: (\n data: Value3D | ValueRotation,\n orientationDegrees: number\n ) => void\n): number {\n const sensorContainer = getSensorContainer();\n return sensorContainer.registerSensor(\n sensorType,\n config,\n makeShareableCloneRecursive(eventHandler)\n );\n}\n\nexport function initializeSensor(\n sensorType: SensorType,\n config: SensorConfig\n): SharedValue<Value3D | ValueRotation> {\n const sensorContainer = getSensorContainer();\n return sensorContainer.initializeSensor(sensorType, config);\n}\n\nexport function unregisterSensor(sensorId: number): void {\n const sensorContainer = getSensorContainer();\n return sensorContainer.unregisterSensor(sensorId);\n}\n\nif (!isWeb()) {\n initializeUIRuntime();\n}\n\ntype FeaturesConfig = {\n enableLayoutAnimations: boolean;\n setByUser: boolean;\n};\n\nlet featuresConfig: FeaturesConfig = {\n enableLayoutAnimations: false,\n setByUser: false,\n};\n\nexport function enableLayoutAnimations(\n flag: boolean,\n isCallByUser = true\n): void {\n if (isCallByUser) {\n featuresConfig = {\n enableLayoutAnimations: flag,\n setByUser: true,\n };\n NativeReanimatedModule.enableLayoutAnimations(flag);\n } else if (\n !featuresConfig.setByUser &&\n featuresConfig.enableLayoutAnimations !== flag\n ) {\n featuresConfig.enableLayoutAnimations = flag;\n NativeReanimatedModule.enableLayoutAnimations(flag);\n }\n}\n\nexport function configureLayoutAnimations(\n viewTag: number,\n type: LayoutAnimationType,\n config:\n | LayoutAnimationFunction\n | Keyframe\n | SharedTransitionAnimationsFunction\n | ProgressAnimationCallback,\n sharedTransitionTag = ''\n): void {\n NativeReanimatedModule.configureLayoutAnimation(\n viewTag,\n type,\n sharedTransitionTag,\n makeShareableCloneRecursive(config)\n );\n}\n\nexport function configureProps(uiProps: string[], nativeProps: string[]): void {\n if (!nativeShouldBeMock()) {\n NativeReanimatedModule.configureProps(uiProps, nativeProps);\n }\n}\n"],"mappings":"AAAA,OAAOA,sBAAsB,MAAM,oBAAoB;AACvD,SAASC,kBAAkB,EAAEC,KAAK,QAAQ,mBAAmB;AAS7D,SAASC,2BAA2B,QAAQ,cAAc;AAK1D,SAASC,mBAAmB,QAAQ,gBAAgB;AAKpD,SAASC,eAAe,QAAQ,mBAAmB;AAEnD,SAASC,WAAW,EAAEC,UAAU,QAAQ,WAAW;AACnD,SAASC,OAAO,EAAEC,OAAO,QAAQ,WAAW;AAC5C,SAASC,aAAa,QAAQ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ACC,OAAO,EAAEC,WAAW,CAAC;EAC7D;AACF"}
|
|
1
|
+
{"version":3,"names":["NativeReanimatedModule","nativeShouldBeMock","isWeb","makeShareableCloneRecursive","initializeUIRuntime","SensorContainer","startMapper","stopMapper","runOnJS","runOnUI","makeShareable","makeMutable","makeRemote","isReanimated3","isConfigured","global","_WORKLET","_log","s","console","log","getViewProp","viewTag","propName","_IS_FABRIC","Error","Promise","resolve","reject","result","substr","getSensorContainer","__sensorContainer","registerEventHandler","eventHash","eventHandler","handleAndFlushAnimationFrame","eventTimestamp","event","__frameTimestamp","__flushAnimationFrame","undefined","unregisterEventHandler","id","subscribeForKeyboardEvents","options","state","height","now","performance","isStatusBarTranslucentAndroid","unsubscribeFromKeyboardEvents","listenerId","registerSensor","sensorType","config","sensorContainer","initializeSensor","unregisterSensor","sensorId","featuresConfig","enableLayoutAnimations","setByUser","flag","isCallByUser","arguments","length","configureLayoutAnimations","type","sharedTransitionTag","configureLayoutAnimation","configureProps","uiProps","nativeProps"],"sources":["core.ts"],"sourcesContent":["import NativeReanimatedModule from './NativeReanimated';\nimport { nativeShouldBeMock, isWeb } from './PlatformChecker';\nimport type {\n AnimatedKeyboardOptions,\n SensorConfig,\n SensorType,\n SharedValue,\n Value3D,\n ValueRotation,\n} from './commonTypes';\nimport { makeShareableCloneRecursive } from './shareables';\nimport type {\n LayoutAnimationFunction,\n LayoutAnimationType,\n} from './layoutReanimation';\nimport { initializeUIRuntime } from './initializers';\nimport type {\n ProgressAnimationCallback,\n SharedTransitionAnimationsFunction,\n} from './layoutReanimation/animationBuilder/commonTypes';\nimport { SensorContainer } from './SensorContainer';\n\nexport { startMapper, stopMapper } from './mappers';\nexport { runOnJS, runOnUI } from './threads';\nexport { makeShareable } from './shareables';\nexport { makeMutable, makeRemote } from './mutables';\n\nexport type ReanimatedConsole = Pick<\n Console,\n 'debug' | 'log' | 'warn' | 'info' | 'error'\n>;\n\n/**\n * @returns `true` in Reanimated 3, doesn't exist in Reanimated 2 or 1\n */\nexport const isReanimated3 = () => true;\n\n// Superseded by check in `/src/threads.ts`.\n// Used by `react-navigation` to detect if using Reanimated 2 or 3.\n/**\n * @deprecated This function was superseded by other checks.\n * We keep it here for backward compatibility reasons.\n * If you need to check if you are using Reanimated 3 or Reanimated 2\n * please use `isReanimated3` function instead.\n * @returns `true` in Reanimated 3, doesn't exist in Reanimated 2\n */\nexport const isConfigured = isReanimated3;\n\n// this is for web implementation\nglobal._WORKLET = false;\nglobal._log = function (s: string) {\n console.log(s);\n};\n\nexport function getViewProp<T>(viewTag: string, propName: string): Promise<T> {\n if (global._IS_FABRIC) {\n throw new Error(\n '[react-native-reanimated] `getViewProp` is not supported on Fabric yet'\n );\n }\n\n return new Promise((resolve, reject) => {\n return NativeReanimatedModule.getViewProp(\n viewTag,\n propName,\n (result: T) => {\n if (typeof result === 'string' && result.substr(0, 6) === 'error:') {\n reject(result);\n } else {\n resolve(result);\n }\n }\n );\n });\n}\n\nexport function getSensorContainer(): SensorContainer {\n if (!global.__sensorContainer) {\n global.__sensorContainer = new SensorContainer();\n }\n return global.__sensorContainer;\n}\n\nexport function registerEventHandler<T>(\n eventHash: string,\n eventHandler: (event: T) => void\n): number {\n function handleAndFlushAnimationFrame(eventTimestamp: number, event: T) {\n 'worklet';\n global.__frameTimestamp = eventTimestamp;\n eventHandler(event);\n global.__flushAnimationFrame(eventTimestamp);\n global.__frameTimestamp = undefined;\n }\n return NativeReanimatedModule.registerEventHandler(\n eventHash,\n makeShareableCloneRecursive(handleAndFlushAnimationFrame)\n );\n}\n\nexport function unregisterEventHandler(id: number): void {\n return NativeReanimatedModule.unregisterEventHandler(id);\n}\n\nexport function subscribeForKeyboardEvents(\n eventHandler: (state: number, height: number) => void,\n options: AnimatedKeyboardOptions\n): number {\n // TODO: this should really go with the same code path as other events, that is\n // via registerEventHandler. For now we are copying the code from there.\n function handleAndFlushAnimationFrame(state: number, height: number) {\n 'worklet';\n const now = performance.now();\n global.__frameTimestamp = now;\n eventHandler(state, height);\n global.__flushAnimationFrame(now);\n global.__frameTimestamp = undefined;\n }\n return NativeReanimatedModule.subscribeForKeyboardEvents(\n makeShareableCloneRecursive(handleAndFlushAnimationFrame),\n options.isStatusBarTranslucentAndroid ?? false\n );\n}\n\nexport function unsubscribeFromKeyboardEvents(listenerId: number): void {\n return NativeReanimatedModule.unsubscribeFromKeyboardEvents(listenerId);\n}\n\nexport function registerSensor(\n sensorType: SensorType,\n config: SensorConfig,\n eventHandler: (\n data: Value3D | ValueRotation,\n orientationDegrees: number\n ) => void\n): number {\n const sensorContainer = getSensorContainer();\n return sensorContainer.registerSensor(\n sensorType,\n config,\n makeShareableCloneRecursive(eventHandler)\n );\n}\n\nexport function initializeSensor(\n sensorType: SensorType,\n config: SensorConfig\n): SharedValue<Value3D | ValueRotation> {\n const sensorContainer = getSensorContainer();\n return sensorContainer.initializeSensor(sensorType, config);\n}\n\nexport function unregisterSensor(sensorId: number): void {\n const sensorContainer = getSensorContainer();\n return sensorContainer.unregisterSensor(sensorId);\n}\n\nif (!isWeb()) {\n initializeUIRuntime();\n}\n\ntype FeaturesConfig = {\n enableLayoutAnimations: boolean;\n setByUser: boolean;\n};\n\nlet featuresConfig: FeaturesConfig = {\n enableLayoutAnimations: false,\n setByUser: false,\n};\n\nexport function enableLayoutAnimations(\n flag: boolean,\n isCallByUser = true\n): void {\n if (isCallByUser) {\n featuresConfig = {\n enableLayoutAnimations: flag,\n setByUser: true,\n };\n NativeReanimatedModule.enableLayoutAnimations(flag);\n } else if (\n !featuresConfig.setByUser &&\n featuresConfig.enableLayoutAnimations !== flag\n ) {\n featuresConfig.enableLayoutAnimations = flag;\n NativeReanimatedModule.enableLayoutAnimations(flag);\n }\n}\n\nexport function configureLayoutAnimations(\n viewTag: number,\n type: LayoutAnimationType,\n config:\n | LayoutAnimationFunction\n | Keyframe\n | SharedTransitionAnimationsFunction\n | ProgressAnimationCallback,\n sharedTransitionTag = ''\n): void {\n NativeReanimatedModule.configureLayoutAnimation(\n viewTag,\n type,\n sharedTransitionTag,\n makeShareableCloneRecursive(config)\n );\n}\n\nexport function configureProps(uiProps: string[], nativeProps: string[]): void {\n if (!nativeShouldBeMock()) {\n NativeReanimatedModule.configureProps(uiProps, nativeProps);\n }\n}\n"],"mappings":"AAAA,OAAOA,sBAAsB,MAAM,oBAAoB;AACvD,SAASC,kBAAkB,EAAEC,KAAK,QAAQ,mBAAmB;AAS7D,SAASC,2BAA2B,QAAQ,cAAc;AAK1D,SAASC,mBAAmB,QAAQ,gBAAgB;AAKpD,SAASC,eAAe,QAAQ,mBAAmB;AAEnD,SAASC,WAAW,EAAEC,UAAU,QAAQ,WAAW;AACnD,SAASC,OAAO,EAAEC,OAAO,QAAQ,WAAW;AAC5C,SAASC,aAAa,QAAQ,cAAc;AAC5C,SAASC,WAAW,EAAEC,UAAU,QAAQ,YAAY;AAOpD;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAAM,IAAI;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,YAAY,GAAGD,aAAa;;AAEzC;AACAE,MAAM,CAACC,QAAQ,GAAG,KAAK;AACvBD,MAAM,CAACE,IAAI,GAAG,UAAUC,CAAS,EAAE;EACjCC,OAAO,CAACC,GAAG,CAACF,CAAC,CAAC;AAChB,CAAC;AAED,OAAO,SAASG,WAAWA,CAAIC,OAAe,EAAEC,QAAgB,EAAc;EAC5E,IAAIR,MAAM,CAACS,UAAU,EAAE;IACrB,MAAM,IAAIC,KAAK,CACb,wEAAwE,CACzE;EACH;EAEA,OAAO,IAAIC,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAAK;IACtC,OAAO5B,sBAAsB,CAACqB,WAAW,CACvCC,OAAO,EACPC,QAAQ,EACPM,MAAS,IAAK;MACb,IAAI,OAAOA,MAAM,KAAK,QAAQ,IAAIA,MAAM,CAACC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,QAAQ,EAAE;QAClEF,M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L,CAACH,cAAc,CAACE,SAAS,IACzBF,cAAc,CAACC,sBAAsB,KAAKE,IAAI,EAC9C;IACAH,cAAc,CAACC,sBAAsB,GAAGE,IAAI;IAC5C/D,sBAAsB,CAAC6D,sBAAsB,CAACE,IAAI,CAAC;EACrD;AACF;AAEA,OAAO,SAASI,yBAAyBA,CACvC7C,OAAe,EACf8C,IAAyB,EACzBb,MAI6B,EAEvB;EAAA,IADNc,mBAAmB,GAAAJ,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAxB,SAAA,GAAAwB,SAAA,MAAG,EAAE;EAExBjE,sBAAsB,CAACsE,wBAAwB,CAC7ChD,OAAO,EACP8C,IAAI,EACJC,mBAAmB,EACnBlE,2BAA2B,CAACoD,MAAM,CAAC,CACpC;AACH;AAEA,OAAO,SAASgB,cAAcA,CAACC,OAAiB,EAAEC,WAAqB,EAAQ;EAC7E,IAAI,CAACxE,kBAAkB,EAAE,EAAE;IACzBD,sBAAsB,CAACuE,cAAc,CAACC,OAAO,EAAEC,WAAW,CAAC;EAC7D;AACF"}
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* with the version used to build the native part of the library in runtime.
|
|
4
4
|
* Remember to keep this in sync with the version declared in `package.json`
|
|
5
5
|
*/
|
|
6
|
-
export const jsVersion = '3.4.
|
|
6
|
+
export const jsVersion = '3.4.1';
|
|
7
7
|
//# sourceMappingURL=jsVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["jsVersion"],"sources":["jsVersion.ts"],"sourcesContent":["/**\n * We hardcode the version of Reanimated here in order to compare it\n * with the version used to build the native part of the library in runtime.\n * Remember to keep this in sync with the version declared in `package.json`\n */\nexport const jsVersion = '3.4.
|
|
1
|
+
{"version":3,"names":["jsVersion"],"sources":["jsVersion.ts"],"sourcesContent":["/**\n * We hardcode the version of Reanimated here in order to compare it\n * with the version used to build the native part of the library in runtime.\n * Remember to keep this in sync with the version declared in `package.json`\n */\nexport const jsVersion = '3.4.1';\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,SAAS,GAAG,OAAO"}
|
|
@@ -7,6 +7,18 @@ export { runOnJS, runOnUI } from './threads';
|
|
|
7
7
|
export { makeShareable } from './shareables';
|
|
8
8
|
export { makeMutable, makeRemote } from './mutables';
|
|
9
9
|
export type ReanimatedConsole = Pick<Console, 'debug' | 'log' | 'warn' | 'info' | 'error'>;
|
|
10
|
+
/**
|
|
11
|
+
* @returns `true` in Reanimated 3, doesn't exist in Reanimated 2 or 1
|
|
12
|
+
*/
|
|
13
|
+
export declare const isReanimated3: () => boolean;
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated This function was superseded by other checks.
|
|
16
|
+
* We keep it here for backward compatibility reasons.
|
|
17
|
+
* If you need to check if you are using Reanimated 3 or Reanimated 2
|
|
18
|
+
* please use `isReanimated3` function instead.
|
|
19
|
+
* @returns `true` in Reanimated 3, doesn't exist in Reanimated 2
|
|
20
|
+
*/
|
|
21
|
+
export declare const isConfigured: () => boolean;
|
|
10
22
|
export declare function getViewProp<T>(viewTag: string, propName: string): Promise<T>;
|
|
11
23
|
export declare function getSensorContainer(): SensorContainer;
|
|
12
24
|
export declare function registerEventHandler<T>(eventHash: string, eventHandler: (event: T) => void): number;
|
package/package.json
CHANGED
package/src/reanimated2/core.ts
CHANGED
|
@@ -30,6 +30,22 @@ export type ReanimatedConsole = Pick<
|
|
|
30
30
|
'debug' | 'log' | 'warn' | 'info' | 'error'
|
|
31
31
|
>;
|
|
32
32
|
|
|
33
|
+
/**
|
|
34
|
+
* @returns `true` in Reanimated 3, doesn't exist in Reanimated 2 or 1
|
|
35
|
+
*/
|
|
36
|
+
export const isReanimated3 = () => true;
|
|
37
|
+
|
|
38
|
+
// Superseded by check in `/src/threads.ts`.
|
|
39
|
+
// Used by `react-navigation` to detect if using Reanimated 2 or 3.
|
|
40
|
+
/**
|
|
41
|
+
* @deprecated This function was superseded by other checks.
|
|
42
|
+
* We keep it here for backward compatibility reasons.
|
|
43
|
+
* If you need to check if you are using Reanimated 3 or Reanimated 2
|
|
44
|
+
* please use `isReanimated3` function instead.
|
|
45
|
+
* @returns `true` in Reanimated 3, doesn't exist in Reanimated 2
|
|
46
|
+
*/
|
|
47
|
+
export const isConfigured = isReanimated3;
|
|
48
|
+
|
|
33
49
|
// this is for web implementation
|
|
34
50
|
global._WORKLET = false;
|
|
35
51
|
global._log = function (s: string) {
|