简体   繁体   English

类型无效 - 期望一个字符串,但得到:未定义

[英]type is invalid -- expected a string but got: undefined

I am trying to use react-bootstrap table 2 and I would like to do column span.我正在尝试使用 react-bootstrap table 2,我想做列跨度。

Here my example,这是我的例子,

<BootstrapTable data={this.state.timesheets} >
    <TableHeaderColumn row="0" dataField='empid'>Field B</TableHeaderColumn>
    <TableHeaderColumn row="0" dataField='tdate'>Field C</TableHeaderColumn>
    <TableHeaderColumn row="0" colSpan="2">In</TableHeaderColumn>
    <TableHeaderColumn row="1">Time</TableHeaderColumn>
    <TableHeaderColumn row="1">Date</TableHeaderColumn>
</BootstrapTable>

I got this error:我收到此错误:

Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.元素类型无效:应为字符串(对于内置组件)或类/函数(对于复合组件)但得到:未定义。 You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.您可能忘记从定义组件的文件中导出组件,或者您可能混淆了默认导入和命名导入。

At the first step, this.state.timesheets would be nothing, so I thought because of this and I added one attribute noDataIndication="Table is Empty" .在第一步, this.state.timesheets什么都不是,所以我想正因为如此,我添加了一个属性noDataIndication="Table is Empty" but this error is still happening.但这个错误仍在发生。

Please help.请帮忙。

According to the documentation, TableHeaderColumn will no longer support in react-bootstrap table 2.根据文档, TableHeaderColumn将不再支持 react-bootstrap 表 2。

Documentation 文档

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 元素类型无效:应为字符串或类/函数,但得到:未定义 - Element type is invalid: expected a string or a class/function but got: undefined 错误:元素类型无效:应为字符串或类/函数,但得到:未定义 - Error: Element type is invalid: expected a string or a class/function but got: undefined Gettting React.createElement:type无效 - 期望一个字符串......但得到:undefined - Gettting React.createElement: type is invalid — expected a string … but got: undefined React Native Element类型无效,预期字符串但未定义 - React Native Element type is invalid expected a string but got undefined React 4 Router error =类型是无效的预期字符串,但未定义 - React 4 Router error = type is invalid expected string but got undefined 不变违规元素类型无效,应为字符串,但未定义 - invariant violation element type is invalid expected a string but got undefined 更新我得到的所有依赖项:元素类型无效:预期为字符串或类/函数(对于复合组件)但得到:未定义 - Updating all dependencies I got: Element type is invalid: expected a string or a class/function (for composite components) but got: undefined 元素类型无效:应为字符串 (...) 但得到:对象 - Element type is invalid: expected a string (...) but got: object React native,元素类型无效:需要一个字符串(对于内置组件)或一个类/函数(对于复合组件),但得到:未定义 - React native, Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined ReactJS + Gulp + Reactify + Browserify元素类型无效:应为字符串,但得到:未定义 - ReactJS + Gulp + Reactify + Browserify Element type is invalid: expected a string but got: undefined
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM