feat(IonRouteInner): migrate to functional component and react router 6

This commit is contained in:
Sean Perkins
2024-07-17 17:01:48 -04:00
parent b6d47ff035
commit 4ecd533aef

View File

@@ -2,29 +2,8 @@ import type { IonRouteProps } from '@ionic/react';
import React from 'react';
import { Route } from 'react-router';
export class IonRouteInner extends React.PureComponent<IonRouteProps> {
render() {
return (
<Route
path={this.props.path}
exact={this.props.exact}
render={this.props.render}
{
/**
* `computedMatch` is a private API in react-router v5 that
* has been removed in v6.
*
* This needs to be removed when we support v6.
*
* TODO: FW-647
*/
...((this.props as any).computedMatch !== undefined
? {
computedMatch: (this.props as any).computedMatch,
}
: {})
}
/>
);
}
}
export const IonRouteInner = ({ path, render }: IonRouteProps) => {
return (
<Route path={path} children={render} />
)
}