🤖 Merge PR #65273 [react-simple-oauth2-login] Change children type to ReactNode by @MysteryBlokHed

This commit is contained in:
Adam Thompson-Sharpe
2023-05-15 13:32:32 -04:00
committed by GitHub
parent 19f1cc04dc
commit 06c07f9cde
2 changed files with 19 additions and 2 deletions

View File

@@ -14,14 +14,14 @@ export interface OAuth2LoginProps {
onSuccess: (data: Record<string, any>) => void;
onFailure: (err: Error) => void;
buttonText?: string;
children?: React.ReactChildren;
children?: React.ReactNode;
popupWidth?: number;
popupHeight?: number;
className?: string;
render?: (props: {
className: string,
buttonText: string,
children: React.ReactChildren,
children: React.ReactNode,
onClick: () => void
}) => void;
isCrossOrigin?: boolean;

View File

@@ -18,3 +18,20 @@ export function Test() {
/>
);
}
export function TestChildren() {
return (
<OAuth2Login
clientId="1234567890"
authorizationUrl="https://example.com/oauth/authorize"
redirectUri="https://example.com/oauth/callback"
responseType="code"
onSuccess={() => {}}
onFailure={() => {}}
>
<div className="child-test"></div>
<div className="child-test"></div>
<div className="child-test"></div>
</OAuth2Login>
);
}