react-spectrum
react-spectrum copied to clipboard
Support server-side rendering components with defaultOpen={true}
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