react-native-reanimated
Version:
More powerful alternative to Animated library for React Native.
28 lines (22 loc) • 625 B
text/typescript
;
import { isFabric } from './PlatformChecker';
import { runOnUI } from './threads';
const IS_FABRIC = isFabric();
let viewTags: number[] = [];
export function removeFromPropsRegistry(viewTag: number) {
viewTags.push(viewTag);
if (viewTags.length === 1) {
queueMicrotask(flush);
}
}
function flush() {
if (__DEV__ && !IS_FABRIC) {
throw new Error('[Reanimated] PropsRegistry is only available on Fabric.');
}
runOnUI(removeFromPropsRegistryOnUI)(viewTags);
viewTags = [];
}
function removeFromPropsRegistryOnUI(viewTags: number[]) {
'worklet';
_removeFromPropsRegistry(viewTags);
}