From e4e562cac5ea65c5362b684177c3ecf35eeb50b3 Mon Sep 17 00:00:00 2001 From: Bill Collins Date: Thu, 12 Dec 2024 01:09:19 +0000 Subject: [PATCH] fix(types): Global JSX namespace is deprecated (#33949) --- packages/playwright-ct-react/hooks.d.ts | 4 +++- packages/playwright-ct-react/index.d.ts | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/playwright-ct-react/hooks.d.ts b/packages/playwright-ct-react/hooks.d.ts index 1093f1a3a3515..f05ad1ffdfbf8 100644 --- a/packages/playwright-ct-react/hooks.d.ts +++ b/packages/playwright-ct-react/hooks.d.ts @@ -14,8 +14,10 @@ * limitations under the License. */ +import type React from 'react'; + export declare function beforeMount( - callback: (params: { hooksConfig?: HooksConfig; App: () => JSX.Element }) => Promise + callback: (params: { hooksConfig?: HooksConfig; App: () => React.JSX.Element }) => Promise ): void; export declare function afterMount( callback: (params: { hooksConfig?: HooksConfig }) => Promise diff --git a/packages/playwright-ct-react/index.d.ts b/packages/playwright-ct-react/index.d.ts index c5e6d6d2da311..d7000c5c85719 100644 --- a/packages/playwright-ct-react/index.d.ts +++ b/packages/playwright-ct-react/index.d.ts @@ -14,6 +14,8 @@ * limitations under the License. */ +import type React from 'react'; + import type { TestType, Locator } from '@playwright/experimental-ct-core'; export interface MountOptions { @@ -22,12 +24,12 @@ export interface MountOptions { export interface MountResult extends Locator { unmount(): Promise; - update(component: JSX.Element): Promise; + update(component: React.JSX.Element): Promise; } export const test: TestType<{ mount( - component: JSX.Element, + component: React.JSX.Element, options?: MountOptions ): Promise; }>;