浏览器控制台错误
You're attempting to animate multiple children within AnimatePresence,
but its exitBeforeEnter prop is set to true. This will lead to odd visual behaviour.
App.js(包含在 BrowserRouter 中)
<Switch>
<AnimatePresence exitBeforeEnter>
<Route key="1" exact path="/" component={Home}/>
<Route key="2" exact path="/home" component={Home}/>
<Route key="3" exact path="/articles" component={Articles}/>
</AnimatePresence>
</Switch>
Home.js/Articles.js
const Home = props =>{
return(
<motion.h1 initial={{x:-100}} animate={{x:0}} exit={{x:-100}}>Home/Articles</motion.h1>
)
}
export default Articles
谁能解释导致错误的原因?