declaration or statement expected javascript/typescript
So, I found the problem. Had to wrap the whole line in parenthesis. So the following is correct.
let x0, x1, y0, y1;
if(this.props.viewport) {
({x0, x1, y0, y1} = this.props.viewport);
}
I had this problem because I was trying to use case
as a variable name e.g. var case = ...
. Now I know this error was because case
is already used by JavaScript's Switch Statement.