I'm getting this error:
Same error when I try to compile:
c:\...\tsx-test>ntsc app/main.tsx
app/components/Note.tsx(13,31): error TS1180: Property destructuring pattern expected.
But I don't know what it's expecting. What's the property syntax?
I'm pretty sure this works as-is in ES6. Is the syntax different in TypeScript?
Note that I'm using TypeScript 1.5.3.
I'm pretty sure this works as-is in ES6.
the {a, b, ...rest} = props
pattern is supported by TypeScript now. Just update to the latest compiler and it will work without error.
Some docs on the TypeScript destructuring:
http://basarat.gitbook.io/typescript/content/docs/destructuring.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With