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

fix: getAnimatableRef on web #6088

Merged
Changes from 1 commit
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
5 changes: 4 additions & 1 deletion src/reanimated2/js-reanimated/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { StyleProps } from '../commonTypes';
import type { AnimatedStyle } from '../helperTypes';
import { isWeb } from '../PlatformChecker';
import { PropsAllowlists } from '../../propsAllowlists';
import { AnimatedComponentRef } from '../../createAnimatedComponent/commonTypes';

// eslint-disable-next-line @typescript-eslint/no-explicit-any
let createReactDOMStyle: (style: any) => any;
Expand Down Expand Up @@ -81,7 +82,9 @@ export const _updatePropsJS = (
isAnimatedProps?: boolean
): void => {
if (viewRef._component) {
const component = viewRef._component;
const component = ((viewRef._component as AnimatedComponentRef).getAnimatableRef
? (viewRef._component as AnimatedComponentRef).getAnimatableRef?.()
: viewRef._component) as JSReanimatedComponent | ReanimatedHTMLElement;
const [rawStyles] = Object.keys(updates).reduce(
(acc: [StyleProps, AnimatedStyle<any>], key) => {
const value = updates[key];
Expand Down
Loading