page active link working immediately after clicking before redirecting to that page how to solve this
here is my component code:
import React, { useState, useEffect } from 'react';
import { useSelector } from 'react-redux';
import { controller } from '../../../../../src/state/StateController';
import BigSourceCodeCard from './BigSourceCodeCard/BigSourceCodeCard';
import ReactPaginate from 'react-paginate';
import { ApkData } from '../../../../../interfaces/models';
import Loader from '../../../../helpers/Loader/Loader';
import { useRouter } from 'next/router';
page active link working immediately after clicking before redirecting to that page how to solve this
here is my component code: import React, { useState, useEffect } from 'react'; import { useSelector } from 'react-redux'; import { controller } from '../../../../../src/state/StateController'; import BigSourceCodeCard from './BigSourceCodeCard/BigSourceCodeCard'; import ReactPaginate from 'react-paginate'; import { ApkData } from '../../../../../interfaces/models'; import Loader from '../../../../helpers/Loader/Loader'; import { useRouter } from 'next/router';
interface Props { apk: Array;
}
const LeftLayout: React.FC = ({ apk }) => {
const router=useRouter()
const states = useSelector(() => controller.states);
const [activePage, setActivePage] = useState(1);
// const {page}=router.query
const pageCount = Math.ceil(states.totalApk / states.itemsPerPage);
const handlePageClick = (event: any) => { const selectedPage = event.selected + 1; console.log('state',states.currentPage) setActivePage(states.currentPage);
return ( <> {apk ? ( <>
); };
export default LeftLayout;