我正在使用样式化组件 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
我是否以错误的方式使用它还是有问题?