-
Notifications
You must be signed in to change notification settings - Fork 38
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]: Determine what is clientOnly prop of <Suspense/>
, <ClientOnly/>
.
#528
Comments
Hello, @manudeli |
@Collection50 Thank you for your interest in Suspensive. If you submit it as a Pull Request, I think we can provide it as an experimental feature. But, There are two reasons why we haven't implemented the ClientOnly component yet.
If you have a use case in mind, please suggest it.
clientOnly in https://github.com/toss/suspensive/blob/main/packages/react/src/hooks/useIsClient.ts is handled by useIsomorphicLayoutEffect. I think it could be a different implementation than useSyncExternalStore in this issue and this could be the problem. It would be nice to provide a unified implementation of the ClientOnly component and the clientOnly prop of Suspense in the same way. |
@Collection50 Here is another implementation of ClientOnly: https://baek2back.gitbook.io/fundamental/hooks/usehydrated
|
<ClientOnly/>
with useSyncExternalStore on react 18<Suspense/>
, <ClientOnly/>
.
@manudeli As you said, I was actually thinking about where to use |
I agree with this opinion if we can use it
Yes, I think that So first, Could you make component with current implementation(Current implemantation: This way use component state to check if component self mounted.) internally without exposing it as public api please? Internal api shouldn't be src/*.tsx. so make file in src/components/ClientOnly.tsx and use it in src/Suspense.tsx please first. |
@gwansikk Care this issue with me please. This will be important improvement if we can |
<Suspense/>
, <ClientOnly/>
.clientOnly prop of <Suspense/>
, <ClientOnly/>
.
As mentioned above, I wanted to work on it, is there anything I can contribute to? |
I would really appreciate it if you could explain your intentions more clearly. |
I assigned you. Thanks for your contributing!
|
Yes I understood that don't expose |
related #528 # Overview Implemented the `ClientOnly` component. ## PR Checklist - [x] I did below actions if need 1. I read the [Contributing Guide](https://github.com/toss/suspensive/blob/main/CONTRIBUTING.md) 2. I added documents and tests. --------- Co-authored-by: Jonghyeon Ko <jonghyeon@toss.im>
Package Scope
@suspensive/react
Possible Solution
etc.
No response
The text was updated successfully, but these errors were encountered: