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

SSR Support #273

Open
mmmoli opened this issue Mar 15, 2021 · 0 comments
Open

SSR Support #273

mmmoli opened this issue Mar 15, 2021 · 0 comments

Comments

@mmmoli
Copy link

mmmoli commented Mar 15, 2021

Nothing fancy here, just checks for typeof window !== undefined.

I'm building a next.js app in TS and found an example app (in Gatsby) with this:

const userbase = typeof window !== 'undefined' ? require('userbase-js').default : null;

Problem: I loose my return types; everything becomes any.

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

1 participant