How to fix the "property destructuring pattern expected" error?

I get this error:

vscode screenshot

The same error when trying to compile:

c:\...\tsx-test>ntsc app/main.tsx
app/components/Note.tsx(13,31): error TS1180: Property destructuring pattern expected.

But I do not know what he expects. What is property syntax?

I am sure it works like ES6. Is the syntax different in TypeScript?

Please note that I am using TypeScript 1.5.3.

+4
source share
1 answer

I am sure it works like ES6.

Template {a, b, ...rest} = propsdesigned for ES7. This is not currently supported by TypeScript.

Note: some documents on supported destructuring: http://basarat.gitbooks.io/typescript/content/docs/destructuring.html

Expected Destructuring Pattern

typescript, , , . {a,b,c}, {a,b,...c}, ...c , .

+6

All Articles