client-component
v1.0.1
Published
Render React component on the client side only, for SSR apps
Downloads
3
Maintainers
Readme
client-component
For server side rendered React applications. A class decorator to restrict rendering to client side only.
usage
import { clientOnly } from 'client-component';
@clientOnly
class ComponentThatAccessesWindowThatIsNotSafeForServerRendering extends Component {
render() {
const currentLocation = window.location;
return (
<div>{currentLocation}</div>
)
};
}