【发布时间】:2020-02-15 05:58:46
【问题描述】:
我有以下 svg 组件,我在其中传递道具。
import React from 'react';
export default (props) => (
<svg {...props}>
<path
d="M11.5 16.45l6.364-6.364"
fillRule="evenodd"
/>
</svg>
);
然后我有一个看起来像这样的styled-component。
const Icon = styled(_Icon)`
${props =>
props.isActive &&
css`
transform: rotate(-180deg);
`};
`;
我看到以下react 错误。
警告:React 无法识别 DOM 元素上的
isActive属性。
【问题讨论】:
-
isActive这个名字有什么特别之处吗?
标签: javascript css reactjs ecmascript-6 styled-components