File tree Expand file tree Collapse file tree 4 files changed +9
-10
lines changed Expand file tree Collapse file tree 4 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import FaviconIco from "../dsfr/favicon/favicon.ico";
77import { getScriptToRunAsap } from "../useIsDark/scriptToRunAsap" ;
88import { fontUrlByFileBasename } from "./zz_internal/fontUrlByFileBasename" ;
99import { getDefaultColorSchemeServerSide } from "./zz_internal/defaultColorScheme" ;
10- import { setLink , type RegisterLink } from "../link" ;
10+ import { setLink } from "../link" ;
1111import { assert } from "tsafe/assert" ;
1212//NOTE: As of now there is no way to enforce ordering in Next Appdir
1313//See: https://github.com/vercel/next.js/issues/16630
@@ -22,7 +22,7 @@ export type DsfrHeadProps = {
2222 */
2323 preloadFonts ?: ( keyof typeof fontUrlByFileBasename ) [ ] ;
2424 /** Default: <a /> */
25- Link ?: RegisterLink extends { Link : infer Link } ? Link : undefined ;
25+ Link ?: Function ;
2626 /**
2727 * When set, the value will be used as the nonce attribute of subsequent script tags.
2828 *
@@ -68,7 +68,7 @@ export function DsfrHead(props: DsfrHeadProps) {
6868
6969 useMemo ( ( ) => {
7070 if ( Link !== undefined ) {
71- setLink ( { Link } ) ;
71+ setLink ( { " Link" : Link as any } ) ;
7272 }
7373 } , [ Link ] ) ;
7474
Original file line number Diff line number Diff line change 11import { start } from "../../start" ;
2- import type { RegisterLink } from "../../link" ;
32import { setLink } from "../../link" ;
43import { type DefaultColorScheme , setDefaultColorSchemeClientSide } from "./defaultColorScheme" ;
54import { isBrowser } from "../../tools/isBrowser" ;
@@ -14,7 +13,7 @@ export function startReactDsfr(params: {
1413 /** Default: false */
1514 verbose ?: boolean ;
1615 /** Default: <a /> */
17- Link ?: RegisterLink extends { Link : infer Link } ? Link : undefined ;
16+ Link ?: Function ;
1817 /**
1918 * When true, the nonce of the script tag will be checked, fetched from {@link DsfrHead} component and injected in react-dsfr scripts.
2019 *
@@ -54,7 +53,7 @@ export function startReactDsfr(params: {
5453 setDefaultColorSchemeClientSide ( { defaultColorScheme } ) ;
5554
5655 if ( Link !== undefined ) {
57- setLink ( { Link } ) ;
56+ setLink ( { " Link" : Link as any } ) ;
5857 }
5958
6059 if ( isBrowser ) {
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ export type CreateNextDsfrIntegrationApiParams = {
3232 /** Default: false */
3333 verbose ?: boolean ;
3434 /** Default: <a /> */
35- Link ?: RegisterLink extends { Link : infer Link } ? Link : undefined ;
35+ Link ?: Function ;
3636 /** If not provided no fonts are preloaded.
3737 * Preloading of fonts is only enabled in production.
3838 */
@@ -121,7 +121,7 @@ export function createNextDsfrIntegrationApi(
121121 const actions : ( ( ) => void ) [ ] = [ ] ;
122122
123123 if ( Link !== undefined ) {
124- setLink ( { Link } ) ;
124+ setLink ( { " Link" : Link as any } ) ;
125125 }
126126
127127 if ( useLang !== undefined ) {
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ export function startReactDsfr(params: {
1212 /** Default: false */
1313 verbose ?: boolean ;
1414 /** Default: <a /> */
15- Link ?: RegisterLink extends { Link : infer Link } ? Link : undefined ;
15+ Link ?: Function ;
1616 /** Default: ()=> "fr" */
1717 useLang ?: ( ) => string ;
1818 /**
@@ -50,7 +50,7 @@ export function startReactDsfr(params: {
5050 } = params ;
5151
5252 if ( Link !== undefined ) {
53- setLink ( { Link } ) ;
53+ setLink ( { " Link" : Link as any } ) ;
5454 }
5555
5656 if ( useLang !== undefined ) {
You can’t perform that action at this time.
0 commit comments