-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
[NoSSR] Port the component from legacy Base UI #593
base: master
Are you sure you want to change the base?
Conversation
Netlify deploy preview |
namespace NoSsr { | ||
export interface Props { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a new pattern? How can people extend the NoSsr prop now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we decided to go with this pattern. See the rationale in #517. The interface should be extendable the same way as without the namespace.
@@ -1,6 +1,6 @@ | |||
--- | |||
productId: base-ui | |||
title: No SSR React component | |||
title: No-SSR React component | |||
description: The No-SSR component defers the rendering of children components from the server to the client. | |||
components: NoSsr | |||
--- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know which one is more correct TBH. @colmtuite, @atomiks, could you chime in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe ClientOnly
is a better name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Client only as client bundle only or client side only? 😁
import { NoSsr } from '@base_ui/react/NoSsr'; | ||
import { Box } from '@mui/system'; | ||
|
||
export default function SimpleNoSsr() { | ||
return ( | ||
<div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about we freeze the height on these demos?
<div> | |
<Box sx={{ height: … }}> |
It layout shifts otherwise when loading the demo page. It's annoying, anchor links to ids below this demo don't work well.
</NoSsr> | ||
</div> | ||
); | ||
} | ||
|
||
const Panel = styled('div')` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I love how it makes the .preview
much easier to follow.
Related to #659 |
Took the NoSSR component from the legacy package, described and published it.
Preview: https://deploy-preview-593--base-ui.netlify.app/components/react-no-ssr/