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

Double apply transition #25

Closed
maccman opened this issue Oct 1, 2020 · 1 comment · Fixed by #45
Closed

Double apply transition #25

maccman opened this issue Oct 1, 2020 · 1 comment · Fixed by #45

Comments

@maccman
Copy link

maccman commented Oct 1, 2020

I'm seeing an issue that is causing a double toggle of the transition classes (even though show is continually true), ultimately resulting in a flash.

The issue looks like it's being caused by the initial variable changing, causing useIsoMorphicEffect to be re-triggered.

It goes like this:

  1. First render of the component (initial = true)
  2. Second render of the component (initial = false)

I'm curious why initial is a dependency on this useEffect?

useIsoMorphicEffect(() => {
    const node = container.current

    if (!node) return

    // Skipping initial transition
    if (initial && !appear) return

   ....
  }, [
    id,
    isTransitioning,
    unregister,
    nesting,
    container,
    initial,

Let me know if that doesn't make sense and I'll put together an example.

@RobinMalfait
Copy link
Collaborator

Hey! Thank you for your bug report!
Much appreciated! 🙏

I'll look into it!

RobinMalfait added a commit that referenced this issue Oct 5, 2020
RobinMalfait added a commit that referenced this issue Oct 5, 2020
RobinMalfait added a commit that referenced this issue Oct 5, 2020
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

Successfully merging a pull request may close this issue.

2 participants