import React from 'react' ; interface Props { description onSubmit : React . EventHandler < React . FormEvent < HTMLFormElement > > ; } export const Form = React . memo ( function Form ( { onSubmit } ) : React . ReactElement { return ( < form onSubmit = { onSubmit } > < input name = "message" / > < button type = "submit" > submit < /button> < /form>); } , ( prevProps , nextProps ) => prevProps . onSubmit === nextProps . onSubmit ) ;