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

feat: support withQuicklink HoC in ssr mode #237

Open
HOUCe opened this issue Jun 7, 2021 · 0 comments
Open

feat: support withQuicklink HoC in ssr mode #237

HOUCe opened this issue Jun 7, 2021 · 0 comments

Comments

@HOUCe
Copy link

HOUCe commented Jun 7, 2021

Hey guys,

Currently withQuicklink component will only be used in browser but it will crash in ssr mode. Casue we bundle prefetch module:

import { listen } from './quicklink';

and prefetch module runs hasPrefetch method which we use document.createElement unsafely:

export const supported = hasPrefetch() ? viaDOM : viaXHR;

It is really hard to modify current prefetch module design to support ssr mode. How about we asynchronously import quicklink from CDN for withQuicklink component. This will prevent crash in ssr mode when use withQuicklink.

PR is on the way if you are ok for the this change.

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