Currently, I am working with Typescript 1.7 and React 0.14 using the new ES6 syntax. Specifically, I am encountering an issue with destructuring assignment, which is explained in detail here.
let x0, x1, y0, y1;
if(this.props.viewport) {
{x0, x1, y0, y1} = this.props.viewport;
}
Despite following the syntax correctly, I keep receiving a
Declaration or statement expected
error. Can someone please point out what mistake I might be making?
Appreciated!