我有一个REACT-STATELESS-COMPONENT
,在一个有TypeScript的项目中.它有一个错误,说
Missing return type on function.eslint(@typescript-eslint/explicit-function-return-type)
我不确定它要我做什么.这是我的代码:
import React, { Fragment} from 'react';
import IProp from 'dto/IProp';
export interface Props {
prop?: IProp;
}
const Component = <T extends object>({ prop }: Props & T) => (
<Fragment>
{prop? (
<Fragment>
Some Component content..
</Fragment>
) : null}
</Fragment>
);
LicenseInfo.defaultProps: {};
export default Component;
你能告诉我需要做什么吗.我需要了解TS,但目前我一点也不了解.因为这个原因,我现在不能做出promise .