Typescript构造函数实现缺少错误

I am referring to this example where in the below code snippet

import * as React from 'react';
export interface IReactMultiEmailProps {
    emails?: string[];
}
export interface IReactMultiEmailState {
    focused?: boolean;
}
declare class ReactMultiEmail extends React.Component<IReactMultiEmailProps, IReactMultiEmailState> {
    state: {
        focused: boolean;
    };
    emailInputRef: React.RefObject<HTMLInputElement>;
    static getDerivedStateFromProps(nextProps: IReactMultiEmailProps, prevState: IReactMultiEmailState): {
        focused: boolean;
    };
    constructor(props: IReactMultiEmailProps);
    handleOnChange: (e: React.SyntheticEvent<HTMLInputElement>) => void;
    render(): JSX.Element;
}
export default ReactMultiEmail;

我收到以下打字稿错误,我正在使用最新版本的打字稿以及react挂钩。

Can any one provide any help on this or any link where I can find the basic template of how to define a ts file with proper constructor, variable, function params as per the latest typescript rules so that i dont get the below errors. Or a modified file of the above example would be helpful. enter image description here

评论