**已关闭。**此问题需要debugging details。当前不接受答案。
编辑问题以包含desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem。这将有助于其他人回答问题。
4天前关闭。
第一个
**已关闭。**此问题需要debugging details。当前不接受答案。
编辑问题以包含desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem。这将有助于其他人回答问题。
4天前关闭。
第一个
1条答案
按热度按时间w51jfk4q1#
错误很明显,你不能把undefined赋给noMargin
最简单的解决方法是使用双重否定运算符
!!
或者,您可以修复styledComponent以接受未定义的
使用
?:
而不是| undefined
的原因取决于是否需要使用noMargin
。https://devblogs.microsoft.com/typescript/walkthrough-interfaces/#describing-simple-types