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

TransitionGroup animates keyed shows before Suspense-Transition is done #38

Open
katywings opened this issue Jul 13, 2023 · 2 comments
Open

Comments

@katywings
Copy link

Is: Currently if a keyed <Show> is used inside of a <TransitionGroup>, and the Show value is suspense-transitioned with startTransition, the exit and enter animations will already run with old state before the Suspense-Transition is even done.

Should: Ideally the animations should only run after the Suspense-Transition.

Video:

Bildschirmaufzeichnung.vom.2023-07-13.19-18-20.mp4

Playground: https://stackblitz.com/edit/github-324i4c-ubu1bo?file=src%2FApp.tsx

Versions:
"solid-js": "^1.7.8",
"solid-transition-group": "0.2.2"

@marvin-j97
Copy link
Contributor

Here's another case, using Transition + Solid Router:

https://stackblitz.com/edit/github-324i4c-h11day?file=src%2FApp.tsx

@g-mero
Copy link

g-mero commented Aug 12, 2024

I use motion-one (which based on solid-transition-group). You should re-config every route component to make it work.

export default function App() {
  const NewFileRoutes = () => FileRoutes().map((route) => {
    return {
      ...route,
      component: (props: any) => {
        return (

          <Motion
            animate={{ opacity: [0, 1] }}
            exit={{ opacity: 0 }}
            transition={{
              duration: 0.2,
            }}
          >
            <route.component {...props} />
          </Motion>

        )
      },
    }
  })
  return (
    <Router
      root={(props) => {
        return (
          <>
            <Nav />
            <Suspense><Presence exitBeforeEnter>{props.children}</Presence></Suspense>
          </>
        )
      }}
    >
      <NewFileRoutes />
    </Router>
  )
}

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

No branches or pull requests

3 participants