1

I looked at what nextjs returns when navigating the page and noticed that the state of hydration is duplicated on the page and transmitted in two different properties of the object: enter image description here I do not understand whether this is the norm of logic or whether it is not a duplication of logic.

I use next-i18next for multilingualism and next-redux-wrapper for hydration of redux storage on the server, and this is exactly the state it creates and is located in these two properties.

Therefore, when I noticed this, I wondered if this was normal logic, since my storage is not so small, and I would not like any extra operations when working on the server.

If you need more information, write in the comments.

UKRman
  • 404
  • 3
  • 16
  • 1
    Do you have a Custom App Component at `./pages/_app.js`? And whether the pageProps and props have exactly the same values? – RobLjm Sep 19 '22 at 18:04

1 Answers1

1

It looks like the two set of props- pageProps and props are related to the loading of the Custom App component and the page component respectively. You can read about Custom App component here

And as the doc states.

pageProps is an object with the initial props that were preloaded for your page by one of our data fetching methods, otherwise it's an empty object.

RobLjm
  • 399
  • 2
  • 11
  • Thank you for your reply, and I have a custom _app.jsx, but I'm still wondering if it's correct that the data is repeated and I should just accept it as a given? – UKRman Sep 20 '22 at 08:18
  • From my understanding of the docs linked in the answer, the data is not repeated. The `pageProps` represents all the props that is passed to the page from a data fetching method like [getServersideProps](https://nextjs.org/docs/basic-features/data-fetching/get-server-side-props) before the page is hydrated. And `props` represents all props passed to the component including those passed from parent components which includes its immediate parent and even the Custom App component. Does that make sense? – RobLjm Sep 20 '22 at 15:51
  • So, I understand correctly, `props` in response to this code https://i.imgur.com/zkn827h.png ? – UKRman Sep 21 '22 at 08:16