【发布时间】:2017-12-25 00:30:25
【问题描述】:
我正在使用样式化组件 v2.1.1。
文档说,为了避免不必要的包装,我们可以使用 .attrs 构造函数。见:https://www.styled-components.com/docs/basics#attaching-additional-props
我尝试使用它,但我总是在控制台中收到以下警告:
Warning: Unknown props `margin`, `padding` on <input> tag. Remove these props from the element. For details, see (removed )
in input (created by styled.input)
in styled.input (created by InputContainer)
in div (created by InputContainer)
in InputContainer
我创建了一个 Webpack Bin 来显示错误:https://www.webpackbin.com/bins/-KpKbVG-Ed0jysHeFVVY
是我用错了还是有问题?
【问题讨论】: