我在和NextJS和ReactJS合作。我已经为我的应用程序UI设置了i layout.js文件。
我想知道为什么我的控制台会返回我:
固定冲突:react.children.Only应接收单个
反应元素子级。
这里是my layout.js:
export default ({ children, title = 'This is the default title' }) => (
<div>
<Head>
<title>{ title }</title>
<meta charSet='utf-8' />
<meta name='viewport' content='initial-scale=1.0, width=device-width' />
</Head>
<div className={style.layout}>
<div>
<div className={style.header}>
<div className= {style.headbar}>
<div className={style.headerLeft}>
<Logo className={style.logo}/>
</div>
<div className={style.headerRight}>
<MenuContainer className={style.menu}/>
</div>
</div>
<div className={style.chatbox}>
<ChatContainer/>
</div>
</div>
{ children }
<div className={style.footer}>
<Link to="/quote" className={style.quote}>
Click here
</Link>
<SocialMedia/>
<Subscription/>
</div>
</div>
</div>
</div>
)
我的wrappedcomponent.js:
const Index = () => (
<Provider store={store}>
<Layout>
<Home/>
</Layout>
</Provider>
)
我不知道怎么了,在我看来一切都很好,如果有人有任何暗示,那就太好了,
thanks