@attio/react-native-bottom-sheet-toolbox
Version:
19 lines (16 loc) • 483 B
JavaScript
;
import React from "react";
import { runOnUI } from "react-native-reanimated";
// biome-ignore lint/suspicious/noExplicitAny: not useful to type
export function useWorkletUiCallback(fcn, deps) {
return React.useCallback((...a) => {
"worklet";
if (_WORKLET) {
fcn(...a);
} else {
runOnUI(fcn)(...a);
}
// biome-ignore lint/correctness/useExhaustiveDependencies: ignore
}, deps);
}
//# sourceMappingURL=use-worklet-ui-callback.js.map