ts/ io-ts and am trying to implement Firebase.Timestamp as a valid type. But I keep getting errors. I can create a normal copy of the time stamp:
copyTimeStamp = {
seconds : t.number,
nanoseconds : t.number
}
but if I push that onto firebase using the custom encoded type from io-ts, it isn't stored as Timestamp property rather its just a plain map..
You need to import FirebaseFirestoreTypes from @react-native-firebase/firestore.
Here it is:
import {FirebaseFirestoreTypes} from '@react-native-firebase/firestore';
...
type StateTypes = {
created_at: FirebaseFirestoreTypes.Timestamp | null;
updated_at: FirebaseFirestoreTypes.Timestamp | null;
}
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