Skip to content

Commit 60b2440

Browse files
committed
fix ts errors
1 parent 52f3bc1 commit 60b2440

File tree

4 files changed

+123
-6247
lines changed

4 files changed

+123
-6247
lines changed

reactfire/components.test.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ describe('SuspenseWithPerf', () => {
171171
<SuspenseWithPerf
172172
traceId={'hello'}
173173
fallback={'loading'}
174-
firePerf={mockPerf()}
174+
firePerf={(mockPerf() as unknown) as performance.Performance}
175175
>
176176
{'children'}
177177
</SuspenseWithPerf>
@@ -204,16 +204,14 @@ describe('AuthCheck', () => {
204204
render(
205205
<React.Suspense fallback={'loading'}>
206206
<AuthCheck
207-
fallback={'not signed in'}
207+
fallback={<h1>not signed in</h1>}
208208
auth={(mockFirebase.auth() as unknown) as auth.Auth}
209209
>
210210
{'signed in'}
211211
</AuthCheck>
212212
</React.Suspense>
213213
)
214214
).not.toThrow();
215-
216-
// if this doesn't throw, it's good
217215
});
218216

219217
test.todo('renders the fallback if a user is not signed in');

reactfire/components.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import * as React from 'react';
2-
import { firebase, auth, performance, User } from 'firebase/app';
2+
import { auth, performance, User } from 'firebase/app';
33
import { useUser, useFirebaseApp } from './index';
44
const { Suspense, useState, useLayoutEffect } = React;
55

66
export interface SuspensePerfProps {
77
children: React.ReactNode;
88
traceId: string;
99
fallback: React.ReactNode;
10-
firePerf?: firebase.performance.Performance; // TODO(jeff): Add firePerf here when it's available
10+
firePerf?: performance.Performance; // TODO(jeff): Add firePerf here when it's available
1111
}
1212

1313
function getPerfFromContext(): performance.Performance {
@@ -23,7 +23,7 @@ function getPerfFromContext(): performance.Performance {
2323

2424
if (!perfFunc || !perfFunc()) {
2525
throw new Error(
26-
"No auth object off of Firebase. Did you forget to import 'firebase/performance' in a component?"
26+
"No perf object off of Firebase. Did you forget to import 'firebase/performance' in a component?"
2727
);
2828
}
2929

0 commit comments

Comments
 (0)