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

Entering Component not animated #117

Open
xeroe opened this issue Aug 2, 2020 · 0 comments
Open

Entering Component not animated #117

xeroe opened this issue Aug 2, 2020 · 0 comments

Comments

@xeroe
Copy link

xeroe commented Aug 2, 2020

Hello,
Im facing the issue that when using this lib only the leaving component is being animated, while the entering one is not.
Instead react is showing a white screen for a second before the second component is popping in.
I tried sticking to the example code as close as possible to prevent but still cant fix the issue and im running out of ideas.

  <Route
    render={({ location }) => (
      <div>
        <AnimatedSwitch
          {...pageTransitions}
          runOnMount={location.pathname === "/"}
          mapStyles={(styles) => ({
            transform: `translateX(${styles.offset}%)`,
          })}
        >
          <Route
            exact
            path="/login"
            component={() => <Login callback={this.login} />}
          />
          <Route exact path="/register" component={Register} />
          <Route exact path="/" component={Landing} />
          <Route
            path="/"
            component={() => <Login callback={this.login} />}
          />
        </AnimatedSwitch>
      </div>
    )}
  />
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

1 participant