作者:熊熊oO7sloveV | 来源:互联网 | 2023-09-14 10:58
Iseethatthefollowingisfine:我认为以下是可以的:constTabconnect(mapState,mapDispatch)(Tabs);
I see that the following is fine:
我认为以下是可以的:
const Tab = connect( mapState, mapDispatch )( Tabs );
export default Tab;
However, this is incorrect:
然而,这是不正确的:
export default const Tab = connect( mapState, mapDispatch )( Tabs );
Yet this is fine:
然而,这是很好:
export default Tab = connect( mapState, mapDispatch )( Tabs );
Can this be explained please why const
is invalid with export default
? Is it an unnecessary addition & anything declared as export default
is presumed a const
or such?
可以解释一下为什么const是无效的出口违约?这是一个不必要的增加&任何声明为出口违约是假定为const或类似?
4 个解决方案