File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ export interface UseDatabaseRefOptions extends _DatabaseRefOptions {}
47
47
export function _useDatabaseRef (
48
48
reference : _MaybeRef < _Nullable < DatabaseReference | Query > > ,
49
49
localOptions : UseDatabaseRefOptions = { }
50
- ) {
50
+ ) : _RefDatabase < unknown > {
51
51
let unbind ! : UnbindWithReset
52
52
const options = Object . assign ( { } , databaseOptionsDefaults , localOptions )
53
53
const initialSourceValue = unref ( reference )
@@ -57,7 +57,7 @@ export function _useDatabaseRef(
57
57
if ( process . env . NODE_ENV !== 'production' ) {
58
58
// is the target a ref that has already been passed to useDocument() and therefore can't be extended anymore
59
59
if ( options . target && checkWrittenTarget ( data , 'useObject()/useList()' ) ) {
60
- return data
60
+ return data as _RefDatabase < unknown >
61
61
}
62
62
}
63
63
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ export function _useFirestoreRef(
69
69
>
70
70
> ,
71
71
localOptions ?: _UseFirestoreRefOptions
72
- ) {
72
+ ) : _RefFirestore < unknown > {
73
73
let unbind : UnbindWithReset = noop
74
74
const options = Object . assign ( { } , firestoreOptionsDefaults , localOptions )
75
75
const initialSourceValue = unref ( docOrCollectionRef )
@@ -82,7 +82,7 @@ export function _useFirestoreRef(
82
82
options . target &&
83
83
checkWrittenTarget ( data , 'useDocument()/useCollection()' )
84
84
) {
85
- return data
85
+ return data as _RefFirestore < unknown >
86
86
}
87
87
}
88
88
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ describe('Firestore SSR', async () => {
44
44
await promise . value
45
45
return { data }
46
46
} ,
47
- ( { data } ) => data . name
47
+ ( { data } ) => data ? .name
48
48
)
49
49
50
50
expect ( await renderToString ( app ) ) . toBe ( `<p>a</p>` )
@@ -58,7 +58,7 @@ describe('Firestore SSR', async () => {
58
58
const data = useDocument ( docRef )
59
59
return { data }
60
60
} ,
61
- ( { data } ) => data . name
61
+ ( { data } ) => data ? .name
62
62
)
63
63
64
64
expect ( await renderToString ( app ) ) . toBe ( `<p>hello</p>` )
You can’t perform that action at this time.
0 commit comments