While using History API on Next.js project, I found a data called '__PRIVATE_NEXTJS_INTERNALS_TREE' in state
field of history object.
To find out what exactly this field for, I tried to search from official docs of Next.js, google on Stack Overflow, search on Next.js GitHub issue tabs, but found nothing related.
What is this data exactly for?
to reproduce, follow below code
// any next.js project
console.log(window.history.state)
Expecting what __PRIVATE_NEXTJS_INTERNALS_TREE is for.
This data represents the history of the previous page URL. For example, if you are on page name cars(can also have the parameters). And then you click on a link and go to any new page. On the new page, you can get the URL of the previous page. And this tree __PRIVATE_NEXTJS_INTERNALS_TREE saves the data of the previous URL.