Failed prop type: Invalid prop height
of type
翻译过来的意思就是 height 属性输入的类型是无效的。
这句话怎么理解呢?
简单来讲就是 height 属性值输入的类型错误,你需要检查一下,此处的数据类型是什么,而你又写了什么。
转入详情,错误如下:
<div style={
{
height: '100%', width: '100%' }}>
{
/* 这里的 height 的属性值是 string类型,而实际上他需要 number类型 */}
<Bar data={
data} width={
Width} height="250" />
</div>
纠正错误,更改结果如下:
<div style={
{
height: '100%', width: '100%' }}>
<Bar data={
data} width={
Width} height={
250} />
</div>