@@ -2,7 +2,7 @@ import { GraphQLSchema } from 'graphql';
2
2
import { ApolloClient , ApolloProvider , InMemoryCache , createHttpLink } from '@apollo/client' ;
3
3
import { SchemaLink } from '@apollo/client/link/schema' ;
4
4
import { ComponentType , Fragment , ReactNode , Suspense , createElement as h , lazy } from 'react' ;
5
- import { Helmet , HelmetProvider , FilledContext } from 'react-helmet-async' ;
5
+ import { Helmet , HelmetProvider , HelmetServerState } from 'react-helmet-async' ;
6
6
import { StaticRouter , StaticRouterProps , Switch } from 'react-router' ;
7
7
import { BrowserRouter , BrowserRouterProps } from 'react-router-dom' ;
8
8
import { Route , RouteComponentProps , withRouter } from '@not-govuk/route-utils' ;
@@ -54,6 +54,10 @@ type ServerError = {
54
54
message : string
55
55
} ;
56
56
57
+ export type HelmetDataContext = {
58
+ helmet : HelmetServerState
59
+ }
60
+
57
61
export type ApplicationPropsSSR = ApplicationPropsCommon & {
58
62
pages : PageInfoSSR [ ]
59
63
} ;
@@ -63,7 +67,7 @@ export type ApplicationProps = ApplicationPropsCSR | ApplicationPropsSSR;
63
67
type ApplicationCSR = ComponentType < ApplicationPropsCSR > ;
64
68
type ApplicationSSR = ComponentType < ApplicationPropsSSR > & {
65
69
extractDataCache : ( ) => object
66
- helmetContext : FilledContext
70
+ helmetContext : HelmetDataContext
67
71
} ;
68
72
export type Application = ComponentType < ApplicationProps > ;
69
73
@@ -304,7 +308,7 @@ export const compose: Compose = options => {
304
308
305
309
return Object . assign ( App , {
306
310
extractDataCache,
307
- helmetContext : helmetContext as FilledContext
311
+ helmetContext : helmetContext as HelmetDataContext
308
312
} ) ;
309
313
} ;
310
314
0 commit comments