You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The input type is different to the output type for a date field, however the types in functions etc do not reflect this.
E.g.
typeProfile={createdAt: Date}const{ add, data }=useCollection<Profile>('profiles')add({// works and correctly stored as a timestamp in FirestorecreatedAt: newDate()})console.log(data[0].createdAtinstanceDate)// false// actually an instance of FirestoreTimestamp
Since the type used is the one passed as a the generic Profile, the type of createdAt in data is wrong.
There is also one exception to this rule: if the cache is being used after add. In that case, there will be two potential types being used... since the cached items that are created via add use the Date types, whereas the cached items from firebase have the FirestoreTimestamp type.
This type mismatch also means that sorting does not work correctly.
The text was updated successfully, but these errors were encountered:
There still the problem of how the cache is organised. It seems unrelated to this issue though, since inserting at the end of the cache is hard-coded into:
The input type is different to the output type for a date field, however the types in functions etc do not reflect this.
E.g.
Since the type used is the one passed as a the generic
Profile
, the type ofcreatedAt
in data is wrong.There is also one exception to this rule: if the cache is being used after
add
. In that case, there will be two potential types being used... since the cached items that are created viaadd
use the Date types, whereas the cached items from firebase have theFirestoreTimestamp
type.This type mismatch also means that sorting does not work correctly.
The text was updated successfully, but these errors were encountered: