0

機能コンポーネント:

const NewRestRequestCoreForm = props => {
    const intl = useIntl();
    ....
    return (
        <Container>
        ....
        </Container>
    );
}

export default React.memo(NewRestRequestCoreForm);

WebStorm は次のエラー/警告を表示します:

Argument type function(any): JSX.Element is not assignable to parameter type SFC<object> ...
Type function(any): JSX.Element is not assignable to type FunctionComponent<object>
Type JSX.Element is not assignable to type ReactElement<any, any> | null 

このコンポーネントをキャッシュしたいだけなので、親が変更されても、渡された小道具はNewRestRequestCoreFormNewRestRequestCoreFormレンダリングされません。

コンポーネントは次のように使用されます。

<NewRestRequestCoreForm a={a}/>

私が間違っていることと、これを修正するにはどうすればよいですか?

編集:

メモを適用して、または適用せずに単純なコンポーネントを使用したところ、警告があっても機能します!

4

0 に答える 0