Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(react): update @types/react to v19+ #30085

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 79 additions & 33 deletions packages/react/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
"@testing-library/react-hooks": "^7.0.1",
"@types/jest": "^26.0.15",
"@types/node": "^14.0.14",
"@types/react": "^17.0.79",
"@types/react-dom": "^17.0.25",
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"@typescript-eslint/eslint-plugin": "^5.48.2",
"@typescript-eslint/parser": "^5.48.2",
"eslint": "^7.32.0",
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/components/IonIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { IonIconInner } from './inner-proxies';
import { createForwardRef, getConfig } from './utils';

interface IonIconProps {
children?: React.ReactNode;
color?: string;
flipRtl?: boolean;
icon?: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/IonRoute.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export interface IonRouteProps {
path?: string;
exact?: boolean;
show?: boolean;
render: (props?: any) => JSX.Element; // TODO(FW-2959): type
render: (props?: any) => React.JSX.Element; // TODO(FW-2959): type
disableIonPageManagement?: boolean;
}

Expand Down
1 change: 1 addition & 0 deletions packages/react/src/components/IonRouterOutlet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { createForwardRef } from './utils';

type Props = LocalJSX.IonRouterOutlet & {
basePath?: string;
children?: React.ReactNode;
ref?: React.Ref<any>;
ionPage?: boolean;
};
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/components/IonicReactProps.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export interface IonicReactProps {
className?: string;
style?: { [key: string]: any };
children?: React.ReactNode;
}
2 changes: 1 addition & 1 deletion packages/react/src/components/createOverlayComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,6 @@ export const createOverlayComponent = <OverlayComponent extends object, OverlayT
}

return React.forwardRef<OverlayType, Props>((props, ref) => {
return <Overlay {...props} forwardedRef={ref} />;
return <Overlay {...(props as Props)} forwardedRef={ref} />;
});
};
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React from 'react';
import ReactDOM from 'react-dom';

import { OverlayEventDetail } from './interfaces';
import { StencilReactForwardedRef, attachProps, dashToPascalCase, defineCustomElement, setRef } from './utils';
import type { OverlayEventDetail } from './interfaces';
import type { StencilReactForwardedRef } from './utils';
import { attachProps, dashToPascalCase, defineCustomElement, setRef } from './utils';

interface OverlayElement extends HTMLElement {
present: () => Promise<void>;
Expand Down Expand Up @@ -137,6 +138,6 @@ export const createOverlayComponent = <OverlayComponent extends object, OverlayT
}

return React.forwardRef<OverlayType, Props>((props, ref) => {
return <Overlay {...props} forwardedRef={ref} />;
return <Overlay {...(props as Props)} forwardedRef={ref} />;
});
};
2 changes: 1 addition & 1 deletion packages/react/src/framework-delegate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { generateId } from './utils/generateId';

// TODO(FW-2959): types

type ReactComponent = (props?: any) => JSX.Element;
type ReactComponent = (props?: any) => React.JSX.Element;

export const ReactDelegate = (
addView: (view: React.ReactElement) => void,
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/models/ReactComponentOrElement.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import type React from 'react';

export type ReactComponentOrElement = React.ComponentClass<any, any> | React.FC<any> | JSX.Element;
export type ReactComponentOrElement = React.ComponentClass<any, any> | React.FC<any> | React.JSX.Element;
1 change: 1 addition & 0 deletions packages/react/src/routing/OutletPageManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import type { RouteInfo } from '../models';
import { StackContext } from './StackContext';

interface OutletPageManagerProps {
children?: React.ReactNode;
className?: string;
forwardedRef?: React.ForwardedRef<HTMLIonRouterOutletElement>;
routeInfo?: RouteInfo;
Expand Down
Loading