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

Ignore layout animation props on web #3714

Merged

Conversation

tomekzaw
Copy link
Member

Description

Fixes #3464.

Currently, Layout Animations are implemented only on Android and iOS.

Using Animated.View with entering, layout or exiting prop on web should be a no-op, but instead it throws the following error:

TypeError: e.LayoutAnimationRepository is undefined
    t createAnimatedComponent.js:151
    setLocalRef createAnimatedComponent.js:149
    default setAndForwardRef.js:7
    r index.js:22

In this PR I've changed the implementation of createAnimatedComponent to disable configuration of layout animation on web, in particular to avoid calling global.LayoutAnimationRepository.registerConfig(tag, config);.

@tomekzaw tomekzaw requested a review from piaskowyk October 24, 2022 16:17
@tomekzaw tomekzaw marked this pull request as ready for review October 24, 2022 16:17
@piaskowyk piaskowyk merged commit 1ebf9e4 into main Oct 26, 2022
@piaskowyk piaskowyk deleted the @tomekzaw/fix-web-layout-animation-repository-undefined branch October 26, 2022 10:42
piaskowyk pushed a commit that referenced this pull request Oct 26, 2022
## Description

Fixes #3464.

Currently, Layout Animations are implemented only on Android and iOS.

Using `Animated.View` with `entering`, `layout` or `exiting` prop on web
should be a no-op, but instead it throws the following error:

```
TypeError: e.LayoutAnimationRepository is undefined
    t createAnimatedComponent.js:151
    setLocalRef createAnimatedComponent.js:149
    default setAndForwardRef.js:7
    r index.js:22
```

In this PR I've changed the implementation of `createAnimatedComponent`
to disable configuration of layout animation on web, in particular to
avoid calling `global.LayoutAnimationRepository.registerConfig(tag,
config);`.
fluiddot pushed a commit to wordpress-mobile/react-native-reanimated that referenced this pull request Jun 5, 2023
## Description

Fixes software-mansion#3464.

Currently, Layout Animations are implemented only on Android and iOS.

Using `Animated.View` with `entering`, `layout` or `exiting` prop on web
should be a no-op, but instead it throws the following error:

```
TypeError: e.LayoutAnimationRepository is undefined
    t createAnimatedComponent.js:151
    setLocalRef createAnimatedComponent.js:149
    default setAndForwardRef.js:7
    r index.js:22
```

In this PR I've changed the implementation of `createAnimatedComponent`
to disable configuration of layout animation on web, in particular to
avoid calling `global.LayoutAnimationRepository.registerConfig(tag,
config);`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

React Native Web Crashes (versions > 2.6.0)
2 participants