Skip to content

Commit

Permalink
fix(types): Global JSX namespace is deprecated (#33949)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrginglymus authored Dec 12, 2024
1 parent 22e58aa commit e4e562c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/playwright-ct-react/hooks.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
* limitations under the License.
*/

import type React from 'react';

export declare function beforeMount<HooksConfig>(
callback: (params: { hooksConfig?: HooksConfig; App: () => JSX.Element }) => Promise<void | JSX.Element>
callback: (params: { hooksConfig?: HooksConfig; App: () => React.JSX.Element }) => Promise<void | React.JSX.Element>
): void;
export declare function afterMount<HooksConfig>(
callback: (params: { hooksConfig?: HooksConfig }) => Promise<void>
Expand Down
6 changes: 4 additions & 2 deletions packages/playwright-ct-react/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<HooksConfig> {
Expand All @@ -22,12 +24,12 @@ export interface MountOptions<HooksConfig> {

export interface MountResult extends Locator {
unmount(): Promise<void>;
update(component: JSX.Element): Promise<void>;
update(component: React.JSX.Element): Promise<void>;
}

export const test: TestType<{
mount<HooksConfig>(
component: JSX.Element,
component: React.JSX.Element,
options?: MountOptions<HooksConfig>
): Promise<MountResult>;
}>;
Expand Down

0 comments on commit e4e562c

Please sign in to comment.