Client Only
client-only
This is a marker package to indicate that a module can only be used in Client Components.
Utilities
react
client-only
Utilities
javascript
npm
frontend
open source
ui
library
web
Stars
1
Weekly
0
Open issues
0
Bundle
~60 kB
Installation
npm install client-onlyCode example
import { useClientOnly } from "client-only";
export function Example() {
const value = useClientOnly();
return <p>{String(value)}</p>;
}Pros & cons
Pros
- Actively maintained by sebmarkbage
- 0 weekly downloads. Battle tested
- MIT licensed
Considerations
- Adds roughly ~60 kB to your bundle
- Needs client-only rendering in SSR frameworks
- Not supported in React Native
- 0 open issues on GitHub