I have an application using React and TypeScript. I recently updated type definitions to use the npm namespace @typesto save them in my folder node_modules.
Previously, when working with DOM events, such a method signature met type definitions:
public updateValue(e: React.FormEvent): void {
Now, however, I get compiler errors:
(46,25): error TS2314: Generic type 'FormEvent<T>' requires 1 type argument(s).
And after searching the reaction type definitions folder, it really takes on a general character:
interface FormEvent<T> extends SyntheticEvent<T> {
}
My question mainly consists of what is used for this general, how to use it and what advantages does it add? I could just change my method to:
public updateValue(e: React.FormEvent<any>): void {
And this will satisfy the type definition requirement. But what is the intended use case?