-
-
Notifications
You must be signed in to change notification settings - Fork 355
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
docs: ClientOnly documentation #1289
Conversation
👌 One thing: most (and many will never) use Btw. I reverted |
Got it, sorry about that, I didn't understand the difference between the scope of vike-react and the scope of react in vike. |
I wonder whether we should document
👍 |
I think it's easier if we have separate sections for each: {/* pages/ClientOnly.page.server.mdx */}
## React
...
## Solid
... It's also a better fit if we eventually implement a UI framework toggle. |
The core logic of each should be mostly the same, so I think it would be nice to first explain the concept of ClientOnly, and then show how it can be implemented in each UI framework.
So, I also believe that the good immediate approach would be to separate each section. |
👍 |
I will add this example for Solid with this PR😀 import { ClientOnly } from "vike-solid/ClientOnly";
function MyComponent() {
return (
<ClientOnly load={() => import('path-to-dynamic-component')} fallback={<Loading />}>
{(Component) => <Component {...props} />}
</ClientOnly>
);
} |
@brillout |
👍
How about creating a new component at |
@brillout
I just want to confirm: does this mean we should create a |
I was thinking more of something around these lines: {/* pages/ClientOnly.page.server.mdx */}
import { ClientOnlyCommon } from './ClientOnly/ClientOnlyCommon.tsx'
## React
...
<ClientOnlyCommon packageName="vike-react" hasDepsArgument={true} ... />
...
## Solid
...
<ClientOnlyCommon packageName="vike-solid" hasDepsArgument={false} ... />
... I think a single page |
Thank you for letting me know and it's great the way. Do I need to worry about syntax highlight? |
Usually what I do is that I define code blocks in small mdx files
|
Thanks for letting me know. |
Perfect 👌 I made some extra polishing; let me know if you disagree with any of it, otherwise I'll merge. I moved the page to |
Thank you for polishing.
No problem🙆♂️
Understood. I'm looking forward to it😀 |
Merged 🎉
Done: 076d17f. Neat PR again 👌 Let me know if something in contribution-welcome 💕 piques your interest 👀 Feel free to PM us on Discord (I tried to find you as |
Thanks!
Oops, I was using my real name. I just renamed it to usk94👌
I'm glad to hear that. Thanks a lot😊 |
ref: vikejs/vike-react#35
For
ClientOnly
documentation.I also made some changes to the description on the client-only-components page, but please feel free to let me know if these are unnecessary.