You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
spa_instat_tv/src/hooks/usePageId.tsx

13 lines
242 B

import { useParams } from 'react-router-dom'
type Params = {
pageId: string,
}
/**
* Хук возвращает id страницы
*/
export const usePageId = () => {
const { pageId } = useParams<Params>()
return Number(pageId)
}