1.0.0 • Published 5 years ago
@jharrilim/if-browser-component v1.0.0
If Browser
Will render children only in browser; useful for components that make use of window
.
Install
npm i @jharrilim/if-browser-component
Example
import React from 'react';
import IfBrowser from '@jharrilim/if-browser-component';
const MyComponent = () => (
<IfBrowser>
<p>{window.innerWidth}</p>
</IfBrowser>
);
1.0.0
5 years ago