Skip to content

Commit

Permalink
Animated: Alias onUpdateRef Type Argument (facebook#46469)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#46469

This causes VS Code to syntax highlight incorrectly, so let's use a type alias to workaround that limitation.

Changelog:
[Internal]

Reviewed By: tyao1

Differential Revision: D62595120

fbshipit-source-id: 97fc3caded51190a7840de91025eeb71c6290be8
  • Loading branch information
yungsters authored and facebook-github-bot committed Sep 14, 2024
1 parent 6bcaa09 commit afb40e9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/react-native/Libraries/Animated/useAnimatedProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ type ReducedProps<TProps> = {
};
type CallbackRef<T> = T => mixed;

type UpdateCallback = () => void;

type AnimatedValueListeners = Array<{
propValue: AnimatedValue,
listenerId: string,
Expand All @@ -52,7 +54,7 @@ export default function useAnimatedProps<TProps: {...}, TInstance>(
allowlist?: ?AnimatedPropsAllowlist,
): [ReducedProps<TProps>, CallbackRef<TInstance | null>] {
const [, scheduleUpdate] = useReducer<number, void>(count => count + 1, 0);
const onUpdateRef = useRef<(() => void) | null>(null);
const onUpdateRef = useRef<UpdateCallback | null>(null);
const timerRef = useRef<TimeoutID | null>(null);

const allowlistIfEnabled = ReactNativeFeatureFlags.enableAnimatedAllowlist()
Expand Down

0 comments on commit afb40e9

Please sign in to comment.