Skip to content

Commit

Permalink
feat: add performance analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
steveoh committed Sep 14, 2022
1 parent 706a0a4 commit 7902383
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getAnalytics } from 'firebase/analytics';
import PropTypes from 'prop-types';
import { useCallback, useState } from 'react';
import { ErrorBoundary } from 'react-error-boundary';
import { AnalyticsProvider, useFirebaseApp } from 'reactfire';
import { AnalyticsProvider, useFirebaseApp, useInitPerformance } from 'reactfire';
import { Button, Card, Collapse } from 'reactstrap';

import MapView from './components/esrijs/MapView';
Expand Down Expand Up @@ -36,6 +36,10 @@ ErrorFallback.propTypes = {

export default function App() {
const app = useFirebaseApp();
useInitPerformance(async () => {
const { getPerformance } = await import('firebase/performance');
return getPerformance(app);
});
const [zoomToGraphic, setZoomToGraphic] = useState({
zoomToGraphic: {
graphic: {},
Expand Down

0 comments on commit 7902383

Please sign in to comment.