maisano / react-router-transition

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

Demo Broke down with Router wrapped around AnimatedSwitch #92

Closed Aubynj closed 6 years ago

Aubynj commented 6 years ago

Using the demo in my React App broke down. Since Router is no more important when using the react-reacter-dom. This is my export Class

export class Main extends Component {
    render(){
        return (
           <section> 
               {/* <Router> */}
                    <AnimatedSwitch
                    atEnter={{ opacity: 0 }}
                    atLeave={{ opacity: 0 }}
                    atActive={{ opacity: 1 }}
                    className="switch-wrapper"          
                    > 
                        <Route exact path="/" component={Home} />
                        <Route path="/Learn" component={Learn} />
                        <Route path="/Downloads" component={Download} />
                        <Route path="/Documentation" component={Documentation} />
                        <Route path="/Sample-Projects" component={Project} />

                    </AnimatedSwitch>
                {/* </Router> */}
            </section>
        )
    }
}

This work perfect without the Router wrapped

maisano commented 6 years ago

hi @Aubynj! i'm guessing the reason that copy-pasting the example into your app didn't work is because you already had a Router higher up in your component tree.