失败的道具类型:道具`children`在`Sidebar`中被标记为必需,但其值为`undefined`
Failed prop type: The prop `children` is marked as required in` Sidebar`, but its value is `undefined`
我使用反应边栏库:https://www.npmjs.com/package/react-sidebar。
我有一个错误:
VM73295 checkPropTypes.js: 20 Warning: Failed prop type: The prop
children
is marked as required inSidebar
, but its value is
undefined
.
<Sidebar
sidebar={
<div className="addPeopleNav">
<Form.Group controlId="exampleForm.ControlTextarea1">
<Form.Label>'mmmmm'</Form.Label>
</Form.Group>
</div>
}
open={this.state.sidebarOpen}
onSetOpen={this.onSetSidebarOpen}
styles={{ sidebar: { background: "white", width: "180px", height: '400px'} }}
pullRight={false}
className="sidebar"
>
</Sidebar>
Sidebar
必须有一个 children
。任何元素都可以
<Sidebar
sidebar={
<div className="addPeopleNav">
<Form.Group controlId="exampleForm.ControlTextarea1">
<Form.Label>'mmmmm'</Form.Label>
</Form.Group>
</div>
}
open={this.state.sidebarOpen}
onSetOpen={this.onSetSidebarOpen}
styles={{ sidebar: { background: "white", width: "180px", height: '400px'} }}
pullRight={false}
className="sidebar"
>
<div />
</Sidebar>
我使用反应边栏库:https://www.npmjs.com/package/react-sidebar。 我有一个错误:
VM73295 checkPropTypes.js: 20 Warning: Failed prop type: The prop
children
is marked as required inSidebar
, but its value isundefined
.
<Sidebar
sidebar={
<div className="addPeopleNav">
<Form.Group controlId="exampleForm.ControlTextarea1">
<Form.Label>'mmmmm'</Form.Label>
</Form.Group>
</div>
}
open={this.state.sidebarOpen}
onSetOpen={this.onSetSidebarOpen}
styles={{ sidebar: { background: "white", width: "180px", height: '400px'} }}
pullRight={false}
className="sidebar"
>
</Sidebar>
Sidebar
必须有一个 children
。任何元素都可以
<Sidebar
sidebar={
<div className="addPeopleNav">
<Form.Group controlId="exampleForm.ControlTextarea1">
<Form.Label>'mmmmm'</Form.Label>
</Form.Group>
</div>
}
open={this.state.sidebarOpen}
onSetOpen={this.onSetSidebarOpen}
styles={{ sidebar: { background: "white", width: "180px", height: '400px'} }}
pullRight={false}
className="sidebar"
>
<div />
</Sidebar>