From 9f8f229e0cb02df1991786a2ea2b5e3901db92fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=ADcholas=20Oliveira?= Date: Thu, 22 Aug 2024 14:39:13 -0300 Subject: [PATCH] fix: type for link component in SettingsContextProps --- .changeset/perfect-pumas-approve.md | 5 +++++ packages/core/src/react/provider/types.ts | 4 ++-- projects/wp-nextjs-app/src/app/layout.tsx | 1 - projects/wp-nextjs/src/pages/_app.tsx | 1 - 4 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 .changeset/perfect-pumas-approve.md diff --git a/.changeset/perfect-pumas-approve.md b/.changeset/perfect-pumas-approve.md new file mode 100644 index 000000000..c95dc893f --- /dev/null +++ b/.changeset/perfect-pumas-approve.md @@ -0,0 +1,5 @@ +--- +"@headstartwp/core": patch +--- + +Fix TS type for link component in SettingsContextProps diff --git a/packages/core/src/react/provider/types.ts b/packages/core/src/react/provider/types.ts index a327c51d1..2fecbb305 100644 --- a/packages/core/src/react/provider/types.ts +++ b/packages/core/src/react/provider/types.ts @@ -1,9 +1,9 @@ -import React, { ReactNode } from 'react'; +import React from 'react'; import type { HeadlessConfig } from '../../types'; import type { IImageBlock } from '../blocks/ImageBlock'; export type SettingsContextProps = { - linkComponent?: ReactNode; + linkComponent?: React.FC; imageComponent?: React.FC; } & HeadlessConfig; diff --git a/projects/wp-nextjs-app/src/app/layout.tsx b/projects/wp-nextjs-app/src/app/layout.tsx index a1af618ff..1934236a0 100644 --- a/projects/wp-nextjs-app/src/app/layout.tsx +++ b/projects/wp-nextjs-app/src/app/layout.tsx @@ -14,7 +14,6 @@ const RootLayout = async ({ const settings: SettingsContextProps = { ...config, - // @ts-expect-error linkComponent: Link, }; diff --git a/projects/wp-nextjs/src/pages/_app.tsx b/projects/wp-nextjs/src/pages/_app.tsx index a2b0d6ac9..cbd799598 100644 --- a/projects/wp-nextjs/src/pages/_app.tsx +++ b/projects/wp-nextjs/src/pages/_app.tsx @@ -41,7 +41,6 @@ const MyApp = ({ Component, pageProps }: AppProps) => { revalidateOnMount: false, }} settings={{ - // @ts-expect-error linkComponent: Link, }} useYoastHtml