Skip to content

Commit 31ac2a2

Browse files
committed
chore: don't SSR FHIR header (it portals)
1 parent e3257c7 commit 31ac2a2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/fhir/components/FhirClientProvider.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@ import { skipToken, useQuery } from '@tanstack/react-query'
55
import { oauth2 } from 'fhirclient'
66
import { Alert, BodyShort, Detail, Heading, Skeleton } from '@navikt/ds-react'
77
import { ErrorBoundary } from 'react-error-boundary'
8+
import dynamic from 'next/dynamic'
89

910
import { isLocalOrDemo } from '@utils/env'
1011
import { getAbsoluteURL, pathWithBasePath } from '@utils/url'
1112
import { NySykmeldingFormDataProvider } from '@components/ny-sykmelding-form/data-provider/NySykmeldingFormDataProvider'
1213
import Test from '@fhir/components/Test'
13-
import FhirHeaderUser from '@fhir/components/FhirHeaderUser'
1414

1515
import { createFhirDataService } from '../data-fetching/fhir-data-service'
1616

17+
const FhirHeaderUser = dynamic(() => import('@fhir/components/FhirHeaderUser'), { ssr: false })
18+
1719
/**
1820
* The FHIR library requires asynchronous initialization, so this component is used to handle the loading state, error state
1921
* and wraps the rest of the tree in a provider when the client is ready.

0 commit comments

Comments
 (0)