Jump to content
Search Community

Alvaro L

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by Alvaro L

  1. Hi @Rodrigo, sorry for my late response, this is exactly what I need! I was already trying to hack around and create customized Router based on TransitionGroup 😑. Still quite interesting that using a config prop works but creating entirely different transition component does not work Here is the working editor link https://stackblitz.com/edit/react-sunf9j?file=src%2Froutes%2FRouter.js Thanks a lot!
  2. Hi @Rodrigo, firstly many thanks for this sample code which works great! I am trying to modify your code so that I can run different animations for each page https://react-sunf9j.stackblitz.io the idea is to use different <TransitionComponent> for each page, which looks like this: const Router = () => { return ( <Routes> <Route index element={ <HomeTransitionComponent> // similar with <TransitionComponent> in the sample code but different gsap animation <HomePage /> </HomeTransitionComponent> } /> <Route path="profile" element={ <ProfileTransitionComponent> // similar with <TransitionComponent> in the sample code but different gsap animation <ProfilePage /> </ProfileTransitionComponent> } /> </Routes> ); }; But I figured that "onExit" callback doesn't work this way and the route we are navigating to will directly appear without timeout. Do you have any idea why using only the same <TransitionComponent> works but using multiple different components doesn't work? I've tried to read the docs but still having a hard time understanding what's happening under the hood between <Router>, <SwitchTransition>, and <Transition> in this setup... Thanks before!
×
×
  • Create New...