maisano / react-router-transition

painless transitions built for react-router, powered by react-motion
http://maisano.github.io/react-router-transition/
MIT License
2.59k stars 138 forks source link

Only transition from first route to second #95

Open ChCosmin opened 6 years ago

ChCosmin commented 6 years ago

Result: When I enter the app the first time I get routed to="/" (sorta of a Welcome to this app page that only appears the first the you entered site) with a button that says "Go to Homepage", on click there's a curtain type slide transition to Homepage and that's it. The other links/paths I don't want to transition, only the first one, how would I go about it?

I'm more or less a beginner to React so the more complex stuff is hard to grasp, I've checked different react modules but almost all of them seem to have the "apply to all routes" method.

Also I'd like to use Redux in my project, if you think that it'll influence the answers please let me know how.

And thank you :)

import React from 'react';
import { Route } from 'react-router-dom';
import FirstPage from './components/FirstPage/index';
import HomePage from './components/HomePage/index';
import './App.css';

const App = () => 
  <div className="routers-container">
    // <Transition>
    <Route exact path="/"         component={ FirstPage } /> <-- only transition from this
    <Route exact path="/homepage" component={ HomePage } />  <-- to this, but from this
    // </Transition>
    <Route exact path="/notransition1" component={ NoTransition1} /> <-- to these route normally(instant)
    <Route exact path="/notransition2" component={ NoTransition2} /> <-- to these route normally(instant)
  </div>

export default App;