Here's a snippet of code that I've been working on:
onFilterChange = ({name}: {name: string}) => {
console.log(`entered onFilterChange and name is ${name}` );
}
When there's only one argument, everything runs smoothly.
However, when I try to add another argument:
onFilterChange = ({name}: {name: string}, {value}: {value: string}) => {
console.log(`entered onFilterChange and name is ${name} and value is ${value}` );
}
Even though it compiles without any errors, at runtime, I encounter the following error: TypeError: _b is undefined
The function above is called like this:
this.props.onChange({name, value});
Is there something obvious that I'm missing here? All the examples I've come across online just have one argument -- which seems to work fine. Thanks for your help!