Skip to content

Flexible class names with CSSTransitionGroup #2680

Closed
@akiran

Description

@akiran

As of now, classes added to animated element is fixed based on transitionName.
Ex: if transitionName="example",
example-enter, example-enter-active, example-leave, example-leave-active classes are added.

Can we provide flexibility in naming classes ?
Ex: fadeIn for enter animation and fadeOut for leave animation
This will help us in using existing css animation libraries with react animation addon.

I propose the following API

transitionName="example" 

adds example-enter, example-enter-active, example-leave, example-leave-active classes.

transitionName={enter: "fadein", leave: "fadeout"}

adds fadein, fadein-active, fadeout, fadeout-active classes

transitionName  =  { 
           enter: "fadein",
           enterActive: "fadeinActive",
           leave: "fadeout",
           leaveActive: "fadeoutActive"
}

adds fadein, fadeinActive, fadeout, fadeoutActive classes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions