File tree Expand file tree Collapse file tree 4 files changed +8
-10
lines changed Expand file tree Collapse file tree 4 files changed +8
-10
lines changed Original file line number Diff line number Diff line change 1- import React , { useMemo , type ReactNode } from "react" ;
1+ import React , { useMemo } from "react" ;
22import { objectKeys } from "tsafe/objectKeys" ;
33import { getAssetUrl } from "../tools/getAssetUrl" ;
44import AppleTouchIcon from "../dsfr/favicon/apple-touch-icon.png" ;
@@ -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 , RegisteredLinkProps } from "../link" ;
10+ import { setLink , type RegisterLink } 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 ?: React . ComponentType < RegisteredLinkProps & { children : ReactNode } > ;
25+ Link ?: RegisterLink extends { Link : infer Link } ? Link : undefined ;
2626 /**
2727 * When set, the value will be used as the nonce attribute of subsequent script tags.
2828 *
Original file line number Diff line number Diff line change 1- import type { ReactNode } from "react" ;
21import { start } from "../../start" ;
3- import type { RegisteredLinkProps } from "../../link" ;
2+ import type { RegisterLink } from "../../link" ;
43import { setLink } from "../../link" ;
54import { type DefaultColorScheme , setDefaultColorSchemeClientSide } from "./defaultColorScheme" ;
65import { isBrowser } from "../../tools/isBrowser" ;
@@ -15,7 +14,7 @@ export function startReactDsfr(params: {
1514 /** Default: false */
1615 verbose ?: boolean ;
1716 /** Default: <a /> */
18- Link ?: React . ComponentType < RegisteredLinkProps & { children : ReactNode } > ;
17+ Link ?: RegisterLink extends { Link : infer Link } ? Link : undefined ;
1918 /**
2019 * When true, the nonce of the script tag will be checked, fetched from {@link DsfrHead} component and injected in react-dsfr scripts.
2120 *
Original file line number Diff line number Diff line change 1- import React , { useEffect , type ReactNode } from "react" ;
1+ import React , { useEffect } from "react" ;
22import Head from "next/head" ;
33import type { NextComponentType } from "next" ;
44import DefaultApp from "next/app" ;
@@ -32,7 +32,7 @@ export type CreateNextDsfrIntegrationApiParams = {
3232 /** Default: false */
3333 verbose ?: boolean ;
3434 /** Default: <a /> */
35- Link ?: React . ComponentType < RegisteredLinkProps & { children : ReactNode } > ;
35+ Link ?: RegisterLink extends { Link : infer Link } ? Link : undefined ;
3636 /** If not provided no fonts are preloaded.
3737 * Preloading of fonts is only enabled in production.
3838 */
Original file line number Diff line number Diff line change 1- import type { ReactNode } from "react" ;
21import { start } from "./start" ;
32import type { RegisterLink , RegisteredLinkProps } from "./link" ;
43import { setLink } from "./link" ;
@@ -13,7 +12,7 @@ export function startReactDsfr(params: {
1312 /** Default: false */
1413 verbose ?: boolean ;
1514 /** Default: <a /> */
16- Link ?: React . ComponentType < RegisteredLinkProps & { children : ReactNode } > ;
15+ Link ?: RegisterLink extends { Link : infer Link } ? Link : undefined ;
1716 /** Default: ()=> "fr" */
1817 useLang ?: ( ) => string ;
1918 /**
You can’t perform that action at this time.
0 commit comments