reactjs 警告解决

1、Warning: getDefaultProps was defined on GraphComponent, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.

解决方法:如果是extend 方式创建的组件,不可以用getDefaultProps设置默认的props值,放在GraphComponent.defaultProps = {}中

 

2、antd.js?8caacf68699ef4b8bd32:72 Warning: validateDOMNesting(...): <div> cannot appear as a descendant of <p>

解决方法:将div中的p标签替换成div就可以

 

3、antd.js?8caacf68699ef4b8bd32:72 Warning: Received `true` for a non-boolean attribute `collapsible`.

解决方法:collapsible 修改为collapsible={“true”}

 

4、antd.js?8caacf68699ef4b8bd32:72 Warning: Received `false` for a non-boolean attribute `className`.

 

If you want to write it to the DOM, pass a string instead: className="false" or className={value.toString()}.

 

If you used to conditionally omit it with className={condition && value}, pass className={condition ? value : undefined} instead.

   

解决方法:xxx &&  styles.dots 修改为xxx ? styles.dots : undefined

 

   

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值