import {useParams, useLocation} from 'react-router-dom'; import { useGetMarketsQuery } from './coinList-api'; import Pager from './coinListPager'; const CoinList = (): JSX.Element => { const location = useLocation() const { page } = useParams(); const { data, error, isLoading, isSuccess, refetch } = useGetMarketsQuery(); console.log(page) console.log(location.search) return (
CoinList { data && data.map((item: any, index: any) => { return ( ) }) }
{item.symbol} {item.id} {item.name} {item.high_24h} {item.low_24h} {item.price_change_percentage_24h}
) } export default CoinList;