Skip to content

How to use with <Outlet /> #29

Open
@KyleRicardo

Description

@KyleRicardo

Hi, I have a common layout and subrouters show in <Outlet />. It worked fine, but I wanted to add some slide animation when I route between pages. So I surround it with <Transition>, it became broken. I didn't find any animation effects. Besides, if I click the go back button on Chrome, both routers' content showed at the same time.

jsx:

<Transition name="slide" appear={true}>
  <Outlet />
</Transition>

css:

.slide-leave-active,
.slide-enter-active {
  transition: all 1s ease;
}
.slide-enter-from {
  transform: translateX(100%);
}
.slide-leave-to {
  transform: translateX(-100%);
}

Sorry to ask this dumb question. But can you show me a simple example about this?

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