React Router Transition Animation将旧路由器清除为白色背景

时间:2018-07-05 07:05:20

标签: reactjs react-router reactcsstransitiongroup

我已经使用ReactCSSTransitionGroup为幻灯片动画实现了React Router过渡,如下http://recordit.co/Bm39Gxir9F

我正在寻找一种方法来防止过渡期间屏幕变白,即让新路由器滑过前一个。有办法实现吗?

这是我的代码

Layout.jsx

<Container className={css['sendcoin']}>
            <ReactCSSTransitionGroup transitionName={transitions} transitionAppearTimeout={1200} transitionLeaveTimeout={1200} transitionAppear={true} transitionEnter={false} transitionLeave={true} >
                <Route path="/send/:type">
                  <div className={css['senddiv']}>
                     <...>
                  </div>
                </Route>
            </ReactCSSTransitionGroup>
</Container>

router.jsx

<Switch>
        <Route exact path='/sign_in' component={SignIn}/>

        <Route>
          <Container>
              <Route component={Authentication}/>
              <Route exact path='/' component={Dashboard}/>
              <Route path='/charge/:type' component={LayoutCharge} />
              <Route path='/send/:type' component={Layout}/>
          </Container>
        </Route>
</Switch>

transitions.css

.appear { 
    transform: translateY(500%);
    z-index: 1000;
}
.appearActive { 
    transform: translateY(0%);
    transition: transform 1200ms;
}

0 个答案:

没有答案