mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Animated: Alias onUpdateRef Type Argument (#46469)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/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
This commit is contained in:
committed by
Facebook GitHub Bot
parent
6bcaa09749
commit
afb40e9f2a
@@ -37,6 +37,8 @@ type ReducedProps<TProps> = {
|
||||
};
|
||||
type CallbackRef<T> = T => mixed;
|
||||
|
||||
type UpdateCallback = () => void;
|
||||
|
||||
type AnimatedValueListeners = Array<{
|
||||
propValue: AnimatedValue,
|
||||
listenerId: string,
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user