Styled-components:React 无法识别 DOM 元素上的 `lineHeight` 属性
Styled-components: React does not recognize the `lineHeight` prop on a DOM element
const props = {
lineHeight: 1.4
};
const Out = styled(OutContainer)`
height: 77px;
`;
Out.defaultProps = props;
错误:
Warning: React does not recognize the lineHeight
prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase lineheight
instead. If you accidentally passed it from a parent component, remove it from the DOM element.
我是样式组件的新手。我错过了什么?
您是否尝试过以下解决方案?
const props = {
style : {
lineHeight: 1.4
}
}
const props = {
lineHeight: 1.4
};
const Out = styled(OutContainer)`
height: 77px;
`;
Out.defaultProps = props;
错误:
Warning: React does not recognize the
lineHeight
prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercaselineheight
instead. If you accidentally passed it from a parent component, remove it from the DOM element.
我是样式组件的新手。我错过了什么?
您是否尝试过以下解决方案?
const props = {
style : {
lineHeight: 1.4
}
}