@jdthornton/screenwidth
v1.0.8
Published
React screen width provider and hooks
Downloads
3
Readme
@jdthornton/screenwidth
React screen width context and hooks.
Install
$ npm install @jdthornton/screenwidth
Usage
import ScreenWidthProvider, { withIsMobile } from "@jdthornton/screenwidth";
const HelloWorld = withIsMobile(({
isMobile
}) => (
<div>
Hello {isMobile ? "Mobile" : "Desktop"} World!
</div>
), 1024)
function App(){
return(
<ScreenWidthProvider>
<HelloWorld />
</ScreenWidthProvider>
)
}