WatermelonDB
WatermelonDB copied to clipboard
type error with text and field
Hi, I'm getting a typescript error with text
and field
import { field, text, } from '@nozbe/watermelondb/decorators'
@text('name') name
@field('sortOrder') sortOrder
Unable to resolve signature of property decorator when called as an expression.
Following https://github.com/Nozbe/WatermelonDB/issues/559,
should I just put export type PropertyDecorator = any
into /decorators/text/index.d.ts
and /decorators/field/index.d.ts
?
I also have the issue
Looks like "experimentalDecorators": true
in the tsconfig.json works for me.
https://www.typescriptlang.org/tsconfig#experimentalDecorators
Not sure about the long term effect - cause this is support for stage3 TC39 decorators, not the legacy ones.
^ That fixed it for me as well.