File tree Expand file tree Collapse file tree 5 files changed +7
-11
lines changed Expand file tree Collapse file tree 5 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -11,15 +11,13 @@ type HTMLAnchorProps = DetailedHTMLProps<
1111> ;
1212
1313// eslint-disable-next-line @typescript-eslint/no-empty-interface
14- export interface RegisterLink { }
14+ export interface RegisterLink { }
1515
1616export type RegisteredLinkProps = RegisterLink extends { Link : infer Link }
1717 ? Omit < UnpackProps < Link > , "children" >
1818 : Omit < HTMLAnchorProps , "children" > ;
1919
20- let Link : (
21- props : RegisteredLinkProps & { children : ReactNode }
22- ) => ReturnType < React . FC > = props => {
20+ let Link : React . ComponentType < RegisteredLinkProps & { children : ReactNode } > = props => {
2321 const { href, ...rest } = props as { to ?: string ; href ?: string } ;
2422
2523 button: {
@@ -42,8 +40,6 @@ let Link: (
4240 return < a href = { href } { ...rest } /> ;
4341} ;
4442
45- //<a {...props} />;
46-
4743export function setLink ( params : { Link : typeof Link } ) : void {
4844 Link = props => {
4945 {
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 RegisteredLinkProps } from "../link" ;
10+ import { setLink , RegisteredLinkProps } 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 ?: ( props : RegisteredLinkProps & { children : ReactNode } ) => ReturnType < React . FC > ;
25+ Link ?: React . ComponentType < RegisteredLinkProps & { children : ReactNode } > ;
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 @@ -15,7 +15,7 @@ export function startReactDsfr(params: {
1515 /** Default: false */
1616 verbose ?: boolean ;
1717 /** Default: <a /> */
18- Link ?: ( props : RegisteredLinkProps & { children : ReactNode } ) => ReturnType < React . FC > ;
18+ Link ?: React . ComponentType < RegisteredLinkProps & { children : ReactNode } > ;
1919 /**
2020 * When true, the nonce of the script tag will be checked, fetched from {@link DsfrHead} component and injected in react-dsfr scripts.
2121 *
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 ?: ( props : RegisteredLinkProps & { children : ReactNode } ) => ReturnType < React . FC > ;
35+ Link ?: React . ComponentType < RegisteredLinkProps & { children : ReactNode } > ;
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 @@ -13,7 +13,7 @@ export function startReactDsfr(params: {
1313 /** Default: false */
1414 verbose ?: boolean ;
1515 /** Default: <a /> */
16- Link ?: ( props : RegisteredLinkProps & { children : ReactNode } ) => ReturnType < React . FC > ;
16+ Link ?: React . ComponentType < RegisteredLinkProps & { children : ReactNode } > ;
1717 /** Default: ()=> "fr" */
1818 useLang ?: ( ) => string ;
1919 /**
You can’t perform that action at this time.
0 commit comments