Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow using withAuthUser with the _app.tsx #143

Closed
droganov opened this issue Apr 15, 2021 · 1 comment
Closed

Allow using withAuthUser with the _app.tsx #143

droganov opened this issue Apr 15, 2021 · 1 comment

Comments

@droganov
Copy link

Not sure if that's a miss-pattern, but it looks reasonable to have the ability to only call withAuthUser once in the app, and make user available to all pages.

Basically, it works, but the typings not OK.

the code:

const MyApp = ({ Component, pageProps }) => {
  return (
    <AuthScreen>
      <Component {...pageProps} />
    </AuthScreen>
  )
}
export default withAuthUser()(MyApp)

the TS error:
image

@kmjennison
Copy link
Contributor

Duplicate of #64. This package probably won't support this in the near future, but here is an example of a way to achieve what you're looking for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants