Warning: Received `false` for a non-boolean attribute `xxx`.

React对boolean类型的attribute的识别方式问题,可以采用以下方法解决:

xxx={value ? 1 : 0}

改成数字的写法,不用布尔值。

具体可以参考:https://github.com/styled-components/styled-components/issues/1198

猜你喜欢

转载自www.cnblogs.com/mengff/p/9822272.html
今日推荐