Skip to content

Commit 6008b7f

Browse files
committed
refactor: Fix component types using react.FC
1 parent e89cbf9 commit 6008b7f

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

packages/payload-authjs/src/components/AccountRowLabel.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
"use client";
22

33
import { useRowLabel } from "@payloadcms/ui";
4+
import type { FC } from "react";
45
import type { Account } from "../authjs/types";
56

6-
export const AccountRowLabel = () => {
7+
export const AccountRowLabel: FC = () => {
78
const { data: account } = useRowLabel<Account>();
89

910
return (

packages/payload-authjs/src/components/SignInWithAuthjsButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ export type SignInWithAuthjsButtonProps = {
2222
/**
2323
* A button that redirects the user to the Auth.js sign in page
2424
*/
25-
export const SignInWithAuthjsButton = ({
25+
export const SignInWithAuthjsButton: React.FC<SignInWithAuthjsButtonProps> = ({
2626
authjsBasePath,
2727
icon = <img src="https://authjs.dev/img/logo-sm.png" alt="Auth.js Logo" />,
2828
text = (
2929
<>
3030
Sign in with <strong>Auth.js</strong>
3131
</>
3232
),
33-
}: SignInWithAuthjsButtonProps) => {
33+
}) => {
3434
return (
3535
<form
3636
style={{ display: "flex", justifyContent: "center" }}

packages/payload-authjs/src/payload/session/PayloadSessionProvider.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ interface Props<TSlug extends CollectionSlug> {
5252
/**
5353
* PayloadSessionProvider that provides the session to the context provider
5454
*/
55-
export const PayloadSessionProvider = <TSlug extends CollectionSlug = "users">({
55+
export const PayloadSessionProvider: React.FC<Props<CollectionSlug>> = <
56+
TSlug extends CollectionSlug = "users",
57+
>({
5658
userCollectionSlug = "users" as TSlug,
5759
session = null,
5860
children,

0 commit comments

Comments
 (0)