有人能解释为什么我必须将“props.children”包裹在一个“div”中才能使react-router工作。使用React渲染props.children
这工作:
export default (props) => {
return (
<div id="main-template">
{props.children}
</div>
);
}
然而,这并不:
export default (props) => {
return (
{props.children}
);
}
任何解释,将不胜感激。
查看[react docs]的相关信息(https://facebook.github.io/react/tips/maximum-number-of-jsx-root-nodes.html) – Uzi