React - expressions must have one parent element?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm relatively new to React and I'm wondering what's the standard here. Imagine I have a react-router like this one: <Router history={history}> <Route path="/" component={App}> <Route path="home component={Home} /> <Route path="about" component={About} /> <Route path="inbox" component={Inbox} /> <Route path="contacts" component={Contacts} /> </Route> </Router> And now I want to remove two routes if prop.mail is set to false , so a sane way of doing that would look like this: <Router history={history}> <Route path="/" component={App}> <Route