mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 11:41:20 +08:00
chore(): React Build Scripts (#19501)
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { IonTabs, IonTabButton, IonLabel, IonIcon, IonTabBar} from '../index';
|
||||
import { render, cleanup } from 'react-testing-library';
|
||||
import { IonRouterOutlet } from '../proxies';
|
||||
import { IonRouterOutlet } from '../IonRouterOutlet';
|
||||
|
||||
afterEach(cleanup)
|
||||
|
||||
|
@ -22,7 +22,7 @@ describe('createComponent - events', () => {
|
||||
|
||||
test('should add custom events', () => {
|
||||
const FakeIonFocus = jest.fn((e) => e);
|
||||
const IonInput = createReactComponent<JSX.IonInput>('ion-input');
|
||||
const IonInput = createReactComponent<JSX.IonInput, HTMLIonInputElement>('ion-input');
|
||||
|
||||
const { getByText } = render(
|
||||
<IonInput onIonFocus={FakeIonFocus}>
|
||||
|
@ -69,8 +69,8 @@ export const isCoveredByReact = (eventNameSuffix: string, doc: Document = docume
|
||||
return isSupported;
|
||||
};
|
||||
|
||||
export const syncEvent = (node: Element, eventName: string, newEventHandler: (e: Event) => any) => {
|
||||
const eventStore = (node as any).__events || ((node as any).__events = {});
|
||||
export const syncEvent = (node: Element & {__events?: {[key: string]: ((e: Event) => any) | undefined}}, eventName: string, newEventHandler?: (e: Event) => any) => {
|
||||
const eventStore = node.__events || (node.__events = {});
|
||||
const oldEventHandler = eventStore[eventName];
|
||||
|
||||
// Remove old listener so they don't double up.
|
||||
|
Reference in New Issue
Block a user