React Page Tracker
A lightweight, zero-dependency library providing accurate navigation tracking, fixed document.referrer value, and complete history support for React frameworks.
DocumentationInstallation
npm i react-page-tracker
Usage
In any client component:
const state = usePageTrackerStore((state) => state);
And you will get following values:
{"pageIndex": 0,"referrer": "","pageEvent": undefined,"isFirstPage": true,"isLastPage": true,"pageHistory": [],"pageHistoryLength": 0,}
Built by Hsuan Yi, Chou