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

feature: SSR #5

Open
Xuhv opened this issue Jun 6, 2024 · 1 comment
Open

feature: SSR #5

Xuhv opened this issue Jun 6, 2024 · 1 comment

Comments

@Xuhv
Copy link

Xuhv commented Jun 6, 2024

Since the DOM is used directly, SSR does not work properly.

const DEFAULT_DOM_ELEMENT = document.body;

return createPortal(
<div
ref={ref}
aria-hidden={!show}
style={{
position: "absolute",
top: coords?.y,
left: coords?.x,
visibility: show ? "visible" : "hidden",
opacity: show ? 1 : 0,
}}
>
<MenuComponent editor={editor} shouldShow={show} />
</div>,
element ?? DEFAULT_DOM_ELEMENT
);

@Xuhv
Copy link
Author

Xuhv commented Jun 6, 2024

I opened a PR #6 , can you check and merge it? I saw that the repository has a github action, so I update the library's version. If the npm token is still valid, The merged code should be automatically released.

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