How does <Component {...pageProps} /> function? How does <Component {...pageProps} /> function? reactjs reactjs

How does <Component {...pageProps} /> function?


Component is provided as a prop from whichever component is calling Name (lets call it Foo).

As you mentioned that navigation changes props, I am assuming that when page is navigated, this Foo undergoes some change and hence passes a different Component and/or pageProps to Name. Hence the Component instance in the new page gets new props.

If you want to call it in other pages, check how it has been passed from Foo and follow the same method in your component.