reactjs - ESLint TableRow 未定义 - 在 .NET Core 项目中反应
问题描述
我在 .NET Core 中创建了 React 项目,并阅读了本教程来学习 React: ReactJs 组件
在上面的示例表中呈现如下:
render() {
return (
<div>
<Header/>
<table>
<tbody>
{this.state.data.map((person, i) => <TableRow key = {i}
data = {person} />)}
</tbody>
</table>
</div>
);
}
我得到错误: TableRow 没有定义。什么是表格行?
解决方案
你能检查一下你是否在你的应用程序的某个地方定义了以下组件吗?
class TableRow extends React.Component {
render() {
return (
<tr>
<td>{this.props.data.id}</td>
<td>{this.props.data.name}</td>
<td>{this.props.data.age}</td>
</tr>
);
}
}
推荐阅读
- java - 如何使用 java 从 derby 数据库中获取表名、约束、外键和引用?
- msbuild - 我们应该如何在通过 msbuild PackageReference 使用 nuget 包的新世界中执行包构建目标?
- reactjs - 安装时调用 componentWillUnmount() - React.js
- c - 从文件中的特定位置读取特定数据(C)
- ios - 如何通过电子邮件将 JSON 转换为 CSV 作为附件 Ionic 3
- azure - API 管理和应用程序认证
- php - 更新用户记录时创建日志记录
- r - 在数据框中创建新的标识符列,其值来自包含嵌套列表的名称
- ios - 带有标题和图像的 UIButton,系统选择的背景不包括图像
- android - 关于移动应用方案深度链接的问题