File tree 3 files changed +6
-12
lines changed
3 files changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -21,8 +21,7 @@ export type DsfrHeadProps = {
21
21
* Preloading of fonts is only enabled in production.
22
22
*/
23
23
preloadFonts ?: ( keyof typeof fontUrlByFileBasename ) [ ] ;
24
- /** Default: <a /> */
25
- Link ?: Function ;
24
+ Link : Function ;
26
25
/**
27
26
* When set, the value will be used as the nonce attribute of subsequent script tags.
28
27
*
@@ -67,9 +66,7 @@ export function DsfrHead(props: DsfrHeadProps) {
67
66
const defaultColorScheme = getDefaultColorSchemeServerSide ( ) ;
68
67
69
68
useMemo ( ( ) => {
70
- if ( Link !== undefined ) {
71
- setLink ( { "Link" : Link as any } ) ;
72
- }
69
+ setLink ( { "Link" : Link as any } ) ;
73
70
} , [ Link ] ) ;
74
71
75
72
return (
Original file line number Diff line number Diff line change @@ -11,9 +11,8 @@ import { setLink } from "../link";
11
11
12
12
export type DsfrProviderProps = {
13
13
children : ReactNode ;
14
- lang ?: string ;
15
- /** Default: <a /> */
16
- Link ?: Function ;
14
+ lang : string | undefined ;
15
+ Link : Function ;
17
16
defaultColorScheme : DefaultColorScheme ;
18
17
} ;
19
18
@@ -33,9 +32,7 @@ export function DsfrProvider(props: DsfrProviderProps) {
33
32
} , [ lang ] ) ;
34
33
35
34
useMemo ( ( ) => {
36
- if ( Link !== undefined ) {
37
- setLink ( { "Link" : Link as any } ) ;
38
- }
35
+ setLink ( { "Link" : Link as any } ) ;
39
36
} , [ Link ] ) ;
40
37
41
38
if ( isBrowser ) {
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ const suppressHydrationWarning = true;
10
10
11
11
export function getHtmlAttributes ( params : {
12
12
defaultColorScheme : DefaultColorScheme ;
13
- lang ? : string ;
13
+ lang : string | undefined ;
14
14
} ) : { suppressHydrationWarning : true ; lang ?: string } & (
15
15
| Record < typeof data_fr_scheme | typeof data_fr_theme , ColorScheme >
16
16
| { }
You can’t perform that action at this time.
0 commit comments