Skip to content

Commit

Permalink
Disable helmet completely for SSR and RSC
Browse files Browse the repository at this point in the history
  • Loading branch information
dac09 committed Jun 24, 2024
1 parent c32ce6b commit 75d53ba
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/web/src/components/RedwoodProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'

// @NOTE: Helmet is not used in SSR & RSC
import * as helmetPkg from 'react-helmet-async'

const { Helmet, HelmetProvider } = helmetPkg

interface RedwoodProviderProps {
Expand All @@ -23,8 +23,10 @@ export const RedwoodProvider = ({
return ''
}

// @TODO (STREAMING): We can remove Helmet, HelmetProvider
// Once we've migrated to using the new PortalHead component
if (RWJS_ENV.RWJS_EXP_STREAMING_SSR) {
return <>{children}</>
}

return (
<HelmetProvider context={globalThis.__REDWOOD__HELMET_CONTEXT}>
<Helmet titleTemplate={template()} defaultTitle={appTitle}>
Expand Down

0 comments on commit 75d53ba

Please sign in to comment.