You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I have a withAuth HOC that checks if the user is logged in and if not, redirects to the login page. This HOC adds a getInitialProps method even if the input component doesn't have one.
Hence, I get a warning message saying that an empty object is returned. But, I don't see how I could do otherwise.
Describe the solution you'd like
Remove the warning.
The text was updated successfully, but these errors were encountered:
In general you'd return a prop to make sure you don't render the page content in those cases (as data is missing).
We're not planning to remove this warning as the majority of use cases where an empty object is returned are misuses of getInitialProps and cause a page to be deoptimized (SSR'ed on demand) even though there is no need for it to be SSRed on demand.
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
vercel
locked as resolved and limited conversation to collaborators
Jan 31, 2022
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Feature request
Is your feature request related to a problem? Please describe.
I have a
withAuth
HOC that checks if the user is logged in and if not, redirects to the login page. This HOC adds agetInitialProps
method even if the input component doesn't have one.Hence, I get a warning message saying that an empty object is returned. But, I don't see how I could do otherwise.
Describe the solution you'd like
Remove the warning.
The text was updated successfully, but these errors were encountered: