Skip to content

Commit

Permalink
change useNavigate to useHistory
Browse files Browse the repository at this point in the history
  • Loading branch information
Enya committed Dec 9, 2023
1 parent 02e6051 commit a4ccb29
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/frontend/js/components/RoomList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { getRoomList } from '../redux/slice/roomSlice'
import Modal from './Modal'
import ErrorModal from './ErrorModal'

import { useNavigate } from 'react-router-dom'
import { useHistory } from 'react-router-dom'
import { createRoom } from '../api'

type obj = {
Expand Down Expand Up @@ -87,7 +87,7 @@ const RoomList: React.FC = () => {
})
}

const navigate = useNavigate()
const history = useHistory()
const [isErrorVisible, setIsErrorVisible] = useState(false)
const [errorText, setErrorText] = useState('')

Expand All @@ -100,7 +100,7 @@ const RoomList: React.FC = () => {

// @ts-ignore
const roomID = res.room.roomId
navigate(`/game/${roomID}`)
history.push(`/game/${roomID}`)
}
})
.catch((err) => {
Expand Down

0 comments on commit a4ccb29

Please sign in to comment.