Skip to content

Commit 24259ad

Browse files
author
Eric Olkowski
committed
Updated errors from react router upgrade
1 parent 6aa63be commit 24259ad

File tree

3 files changed

+7
-29
lines changed

3 files changed

+7
-29
lines changed

packages/react-integration/cypress/integration/label.spec.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,4 @@ describe('Label Demo Test', () => {
3636
cy.wrap(noTooltipLinkMaxWidth).trigger('mouseleave');
3737
});
3838
});
39-
40-
it('Verify router link label', () => {
41-
cy.get('#router-link > .pf-v6-c-label__content').then((routerTooltipLink: JQuery<HTMLDivElement>) => {
42-
cy.get('.pf-v6-c-tooltip').should('not.exist');
43-
cy.wrap(routerTooltipLink).trigger('mouseenter').get('.pf-v6-c-tooltip').should('exist');
44-
});
45-
cy.get('#router-link > a').invoke('attr', 'href').should('eq', '/');
46-
});
4739
});

packages/react-integration/demo-app-ts/src/App.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { BrowserRouter as Router, Route, Link, Switch } from 'react-router-dom';
2+
import { BrowserRouter as Router, Route, Link, Routes } from 'react-router-dom';
33
import { Avatar } from '@patternfly/react-core/dist/esm/components/Avatar';
44
import { Brand } from '@patternfly/react-core/dist/esm/components/Brand';
55
import {
@@ -63,28 +63,28 @@ class App extends React.Component<{}, AppState> {
6363
private getPages = () => {
6464
const defaultDemo = Demos.find((demo) => demo.isDefault);
6565
return (
66-
<Switch>
66+
<Routes>
6767
{Demos.map((demo) => (
6868
<Route
6969
path={`/${demo.id}-nav-link`}
70-
render={() => (
70+
element={
7171
<PageSection id={`/${demo.id}-page-section`}>{React.createElement(demo.componentType)}</PageSection>
72-
)}
72+
}
7373
key={demo.id}
7474
/>
7575
))}
7676
{defaultDemo ? (
7777
<Route
7878
path="/"
79-
render={() => (
79+
element={
8080
<PageSection id={`/${defaultDemo.id}-page-section`}>
8181
{React.createElement(defaultDemo.componentType)}
8282
</PageSection>
83-
)}
83+
}
8484
key={defaultDemo.id}
8585
/>
8686
) : null}
87-
</Switch>
87+
</Routes>
8888
);
8989
};
9090

packages/react-integration/demo-app-ts/src/components/demos/LabelDemo/LabelDemo.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Label } from '@patternfly/react-core';
22
import { Component } from 'react';
33
import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon';
4-
import { Link } from 'react-router-dom';
54

65
export class LabelDemo extends Component {
76
componentDidMount() {
@@ -57,19 +56,6 @@ export class LabelDemo extends Component {
5756
<Label id="overflow-label" variant="overflow">
5857
Overflow label
5958
</Label>
60-
<Label
61-
id="router-link"
62-
color="blue"
63-
icon={<InfoCircleIcon />}
64-
textMaxWidth="100px"
65-
render={({ className, content, componentRef }) => (
66-
<Link to="/" className={className} innerRef={componentRef}>
67-
{content}
68-
</Link>
69-
)}
70-
>
71-
Blue label fake router link with icon that overflows
72-
</Label>
7359
<Label
7460
color="blue"
7561
isEditable

0 commit comments

Comments
 (0)