Skip to content

An option to make Animatable Components not animate on mount #186

@AlicanC

Description

@AlicanC

I have something like this:

const MyComponent = ({ isShown }) => (
  <Animatable.View
    animation={isShown ? 'fadeInUp' : 'fadeOutDown'}
  >
    <ContentHere />
  </Animatable.View>
);

The goal here is to make MyComponent show and hide itself according to the isShown prop. The problem is that Animatable.View animates when it's mounted so when I render <MyComponent isShown={false}> the user sees the component appear and fade out.

Could we add a prop to Animatable Components to make them initially render a completed animation (in this example, a completed fadeOutDown) so they don't animate on mount, but only when animation prop changes?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions