Skip to content

Commit a4902a0

Browse files
committed
chore: update react-router imports useHistory -> useNavigate
1 parent 746096b commit a4902a0

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/pages/About.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React, { Fragment } from 'react'
2-
import { useHistory } from 'react-router-dom'
2+
import { useNavigate } from 'react-router-dom'
33

44
export const About: React.FC = () => {
5-
const history = useHistory()
5+
const navigate = useNavigate()
66

77
return (
88
<Fragment>
@@ -17,7 +17,7 @@ export const About: React.FC = () => {
1717
type="button"
1818
className="btn"
1919
cy-data="go-back-button"
20-
onClick={() => history.push('/')}
20+
onClick={() => navigate('/')}
2121
>
2222
Go back
2323
</button>

template/src/pages/About.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React, { Fragment } from 'react'
2-
import { useHistory } from 'react-router-dom'
2+
import { useNavigate } from 'react-router-dom'
33

44
export const About: React.FC = () => {
5-
const history = useHistory()
5+
const navigate = useNavigate()
66

77
return (
88
<Fragment>
@@ -13,7 +13,7 @@ export const About: React.FC = () => {
1313
omnis doloremque itaque eius eaque sint facilis unde tenetur reiciendis
1414
aliquam soluta?
1515
</p>
16-
<button type="button" className="btn" onClick={() => history.push('/')}>
16+
<button type="button" className="btn" onClick={() => navigate('/')}>
1717
Go back
1818
</button>
1919
</Fragment>

0 commit comments

Comments
 (0)