I've just updated typescript to 3.7.4 and I am trying to edit my code.
I have a simple code
interface Test
event: {
queryStringParameters: { [name: string]: string } | null;
}
}
const test:Test = (event) => {
// const { no } = event?.queryStringParameters; //Property 'no' does not exist on type '{ [name: string]: string; } | null'.ts(2339)
const no = event?.queryStringParameters?.no; //It works but I want to use above that.
...
}
I want to use the optional chaining with destructuring.
Is it available feature now?