Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove collapsable props from Animated component #2569

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,11 @@ import {

import useLayoutEffect from '../../../modules/useLayoutEffect';

type ReducedProps<TProps> = {
...TProps,
collapsable: boolean,
...
};
type CallbackRef<T> = T => mixed;

export default function useAnimatedProps<TProps: {...}, TInstance>(
props: TProps,
): [ReducedProps<TProps>, CallbackRef<TInstance | null>] {
): [TProps, CallbackRef<TInstance | null>] {
const [, scheduleUpdate] = useReducer(count => count + 1, 0);
const onUpdateRef = useRef<?() => void>(null);

Expand Down Expand Up @@ -102,12 +97,9 @@ export default function useAnimatedProps<TProps: {...}, TInstance>(

function reduceAnimatedProps<TProps>(
node: AnimatedProps,
): ReducedProps<TProps> {
// Force `collapsable` to be false so that the native view is not flattened.
// Flattened views cannot be accurately referenced by the native driver.
): TProps {
return {
...node.__getValue(),
collapsable: false,
};
}

Expand Down