Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: type for link component in SettingsContextProps #854

Merged
merged 1 commit into from
Aug 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/perfect-pumas-approve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@headstartwp/core": patch
---

Fix TS type for link component in SettingsContextProps
4 changes: 2 additions & 2 deletions packages/core/src/react/provider/types.ts
Original file line number Diff line number Diff line change
@@ -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<any>;
imageComponent?: React.FC<IImageBlock>;
} & HeadlessConfig;

Expand Down
1 change: 0 additions & 1 deletion projects/wp-nextjs-app/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const RootLayout = async ({

const settings: SettingsContextProps = {
...config,
// @ts-expect-error
linkComponent: Link,
};

Expand Down
1 change: 0 additions & 1 deletion projects/wp-nextjs/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,12 @@
revalidateOnMount: false,
}}
settings={{
// @ts-expect-error
linkComponent: Link,
}}
useYoastHtml
>
<Layout>
<Component {...props} />

Check warning on line 49 in projects/wp-nextjs/src/pages/_app.tsx

View workflow job for this annotation

GitHub Actions / eslint (20.x)

Prop spreading is forbidden
</Layout>
</HeadlessApp>
);
Expand Down
Loading