mr-media-query
v0.1.1
Published
Here are some examples on how you can use the `mc-media-query package` hook in your component:
Downloads
1
Readme
npm install mc-media-query
yarn add mc-media-query
Here are some examples on how you can use the mc-media-query package
hook in your component:
Examples
navState hook in your component:
import { navState } from "mc-media-query";
const App = () => { const { state, handleToggleNav } = navState({ toggle: false });
return (
export default App;
useMediaQueryScreen hook in your component:
import { useMediaQueryScreen } from "mc-media-query"
const App = () => { const isMobile = useMediaQueryScreen("(max-width: 768px)");
return (
export default App;
useScrollHeight hook in your component:
import { useScrollHeight } from "mc-media-query";
const App = () => { const { matches } = useScrollHeight("example-query", 200);
return (
export default App;
Check out mc-media-query for more details.