reactjs - 我无法访问 reactjs 中的类属性
问题描述
Implementation:
<tr>
<td class = 'show_hours'>{Number(this.props.showHours).toLocaleString()}</td>
<td class = 'waiting_hours'>{Number(this.props.waiting).toLocaleString()}</td>
</tr>
/*Testcase:
describe('RenderJobsRow',() => {
it('Commas separated with Numbers.',() => {
const wrapper = shallow(<RenderJobsRow
showHours={23567}
waiting ={3214524}
/>)
expect(wrapper.find('.show_hours').text()).toEqual('23,567')
expect(wrapper.find('.waiting_hours').text()).toEqual('3,214,524')
})
})
* /*当前错误信息:
/*方法“文本”仅用于在单个节点上运行。找到了 0 个
*
解决方案
<tr>
<td className = 'show_hours'>{Number(this.props.showHours).toLocaleString()}</td>
<td className = 'waiting_hours'>{Number(this.props.waiting).toLocaleString()}</td>
</tr>
推荐阅读
- java - AWS SQS Maven 依赖项抛出 java.lang.NoClassDefFoundError : software/amazon/awssdk/services/sqs/SqsClient On Runtime
- types - 在 Julia 中调度具体抽象类型与参数类型
- r-raster - 如何重新分配 R 星对象中的单元格/像素值
- php - 如何在nodejs应用程序中创建等效于php代码的openssl加密和解密
- scala - Spark SQL Dataframes - 如果使用 RDD.collectAsMap() 创建地图,则 DataFrameNaFunctions 的替换函数不起作用
- python - 在同一列熊猫中提取多个字符串组
- python - Scikit Learn)在并行运行多个随机森林时,n_jobs=-1 仍然比 n_jobs=c 快吗?
- hbase - HBase 区域无法正确故障转移,卡在“OPENING”RIT 中
- react-native - JSON 值 '
' 在将其运行到 ios android 时的类型工作正常 - cassandra - CAS写入查询期间的Cassandra WriteTimeoutException