react-spectrum icon indicating copy to clipboard operation
react-spectrum copied to clipboard

Support server-side rendering components with defaultOpen={true}

Open lithdew opened this issue 1 year ago โ€ข 0 comments

Provide a general summary of the feature here

Components that are portaled into i.e. document.body, such as Modal, do not support server-side rendering.

๐Ÿค” Expected Behavior?

That portaled components can be server-side rendered.

๐Ÿ˜ฏ Current Behavior

Portaled components are not server-side rendered.

๐Ÿ’ Possible Solution

Provide an option to potentially bypass the useIsSSR() check for portals for components that rely on portals.

๐Ÿ”ฆ Context

I noticed that when defaultOpen={true} for modals, they are not server-side rendered. For a login dialog for example, it would be useful to have it server-side rendered should a user not be authenticated and to have its event listeners etc. attached when hydration occurs.

๐Ÿ’ป Examples

No response

๐Ÿงข Your Company/Team

No response

๐Ÿ•ท Tracking Issue

No response

lithdew avatar Apr 22 '24 02:04 lithdew