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

Does not work with SSR #10

Open
benjick opened this issue Oct 19, 2022 · 2 comments
Open

Does not work with SSR #10

benjick opened this issue Oct 19, 2022 · 2 comments

Comments

@benjick
Copy link
Contributor

benjick commented Oct 19, 2022

Hey! Great library, thanks for making this!

I'm using it with NextJS but it does not support SSR. I made this change locally: #9 and then it works if I wrap it with dynamic:

const SortableTreeClient: any = dynamic(() => Promise.resolve(SortableTree), {
  ssr: false,
});

But it still gives me some issues with document if I don't wrap it in dynamic. I think it's related to this line:

but I haven't used portals before so I'm not sure how to solve it.

Cheers

@Shaddix
Copy link
Owner

Shaddix commented Oct 19, 2022

Thanks for the PR!
I merged it and pushed a version to npm.
Personally I haven't used it with SSR, so can't advice much. If something could be changed in a library to make it easier, PRs are more than welcome!

@benjick
Copy link
Contributor Author

benjick commented Oct 19, 2022

Thanks @Shaddix!

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