Replies: 1 comment
-
|
I have some suggestions to make your Typescript experience better.
Hope this helps. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! I'm using Realm JS for a React-Native app written in TypeScript and I'm wondering about the typing of
Realm.Results.here is my use case:
My Schema for 'MessageData' is:
Here is the typing is use to fetch data from the database (fetches the MessageData of a particular conversation, with its conversationId).
const databaseMessages: Realm.Results<MessageData> = realm.objectForPrimaryKey<Realm.Results<MessageData>>('MessageData', conversationId)With this type, I get an error further down my code when I add a listener to the database:
Property 'messages' does not exist on type 'Results'.ts(2339)
any thoughts why this might be happening? thanks a lot!
Beta Was this translation helpful? Give feedback.
All reactions