我正在尝试使用带有typescript的react-spring,即使在第一次测试时,我也遇到了如下大的typescript检查问题。
我的用法中是否存在基本错误,或者没有太多痛苦的解决方法?
<div>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
给予:
<Spring
from={{ number: 0 }}
to={ { number: num } }
delay = {delay}
config = { config.molasses }>
>
{props => <div>{props.number.toFixed() }</div>}
</Spring>
可能是打字稿和React.Children问题。 React Component children typecheck with typescript
答案 0 :(得分:0)
在我的副本中增加了额外的>
。 TSX!