There's an event handler function in my project, which takes 'event' as the only parameter.There's only one format working in the project.
E.g. If a line of console.log is added to the function body, it would be displayed only in the first format.
The framework is an internal one, based on React, also uses web components.
What are the difference between these formats?
All three formats have the same function body.
Format 1, working in my project:
public sendClickEvent = ({ event: e }) => {
e.preventDefault();
// handler body
}
Format 2, not working in my project:
public sendClickEvent = (event: any) => {
event.preventDefault();
// handler body
}
Format 3, not working in my project:
public sendClickEvent(event: any): void {
event.preventDefault();
// handler body
}