Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

OSUblake last won the day on September 22

OSUblake had the most liked content!

OSUblake

Administrators
  • Posts

    7,062
  • Joined

  • Last visited

  • Days Won

    617

Blog Post Comments posted by OSUblake

  1. 11 hours ago, Alixsep said:

    I got a question though, won't using .from method cause initial render glitch or flash? for example the whole dom might be visible before .from method sets some elements to opacity 0

     

    That's we recommended using useLayoutEffect as it will run before the DOM gets painted to the screen. The only time that won't happen is when using SSR and your app hasn't been hydrated. For that, you might need to do something similar to option 2 here.

    https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85

     

    11 hours ago, Alixsep said:

    also May you please add examples of transition between routes? For example when I go from homepage to about page, how to animate that?

     

    Yeah, we'll work on a demo for that, although it's a little more complicated because it involves keeping track of elements using state and React's Children API.

     

    • Like 1
  2. 34 minutes ago, React said:

    I think the last section of `useIsomorphicLayoutEffect` only avoids the warning but does not actually fix the problem

     

    Thanks for the input, @React. You're absolutely correct. For fading in, it would probably be better to just have the opacity set to 0 ahead of time. But we needed a demo, and it's easy to demonstrate fading in. Other uses for useLayoutEffect, like when pinning ScrollTriggers aren't as easy to demonstrate in a simple CodePen.

     

    Do you think it be better if we just removed that part from the guide?

    • Like 2
×