client-component
1.0.1 • Public • Published 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>
)
};
}
Versions
Version | Downloads (Last 7 Days) | Tag |
---|
1.0.1 | 0 | latest |
Version History
Version | Downloads (Last 7 Days) | Published |
---|
1.0.1 | 0 | |
1.0.0 | 0 | |
Package Sidebar
Install
Weekly Downloads