react-layout-switch
v1.0.0
Published
Simple path-based desktopmobile switching
Downloads
3
Readme
React Layout Switch
Simple path-based desktop/mobile switching
Usage
import LayoutSwitch from 'react-layout-switch'
function App() {
const layout = window.innerWidth > window.innerHeight ? 'desktop' : 'mobile'
return (
<LayoutSwitch layout={layout} mobilePrefix='m'>
...
</LayoutSwitch>
)
}
- Renders
/m/...
if mobile - Otherwise renders
/...