All Projects → lessmess-dev → react-media-hook

lessmess-dev / react-media-hook

Licence: MIT license
React Hook for Media Queries

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to react-media-hook

Ocmethodtrace
Trace Any Objective-C Method Calls
Stars: ✭ 194 (+223.33%)
Mutual labels:  hook
Xmark
A PHP7 extension that can hook most functions/classes and parts of opcodes
Stars: ✭ 209 (+248.33%)
Mutual labels:  hook
Component Size
React hook for determining the size of a component
Stars: ✭ 224 (+273.33%)
Mutual labels:  hook
Simple Git Hooks
A simple git hooks manager for small projects
Stars: ✭ 179 (+198.33%)
Mutual labels:  hook
Elfhook
modify PLT to hook api, supported android 5\6.
Stars: ✭ 202 (+236.67%)
Mutual labels:  hook
Understand Plugin Framework
demos to help understand plugin framwork
Stars: ✭ 2,507 (+4078.33%)
Mutual labels:  hook
Headwolf
Scaffolding for agile development based on Xposed and Sekiro/基于Xposed和Sekiro搭建的敏捷开发的脚手架🎁献给懒汉们的小礼物😘只需四步!部署完一个Hook项目!👋👋新版本只需两步!!!
Stars: ✭ 182 (+203.33%)
Mutual labels:  hook
use-route-as-state
Use React Router route and query string as component state
Stars: ✭ 37 (-38.33%)
Mutual labels:  hook
Xhook
🔥 A PLT hook library for Android native ELF.
Stars: ✭ 2,996 (+4893.33%)
Mutual labels:  hook
Frida Skeleton
基于frida的安卓hook框架,提供了很多frida自身不支持的功能,将hook安卓变成简单便捷,人人都会的事情
Stars: ✭ 222 (+270%)
Mutual labels:  hook
Wmi Static Spoofer
Spoofing the Windows 10 HDD/diskdrive serialnumber from kernel without hooking
Stars: ✭ 199 (+231.67%)
Mutual labels:  hook
Qujing
曲境是一个xposed模块,可实现在PC浏览器上动态监控(hook)函数调用和查看堆栈信息,及反射调用(invoke)等功能。
Stars: ✭ 197 (+228.33%)
Mutual labels:  hook
Neteasemusiccrack
iOS网易云音乐 免VIP下载、去广告、去更新 无需越狱...
Stars: ✭ 221 (+268.33%)
Mutual labels:  hook
Bigbang
Stars: ✭ 194 (+223.33%)
Mutual labels:  hook
Zxhookdetection
【iOS应用安全、安全攻防】hook及越狱的基本防护与检测(动态库注入检测、hook检测与防护、越狱检测、签名校验、IDA反编译分析加密协议Demo);【数据传输安全】浅谈http、https与数据加密
Stars: ✭ 241 (+301.67%)
Mutual labels:  hook
Ios Monitor Platform
📚 iOS 性能监控 SDK —— Wedjat(华狄特)开发过程的调研和整理
Stars: ✭ 2,316 (+3760%)
Mutual labels:  hook
Fridacontainer
FridaContainer 整合了网上流行的和自己编写的常用的 frida 脚本,为逆向工作提效之用。 frida 脚本模块化,Java & Jni Trace。
Stars: ✭ 190 (+216.67%)
Mutual labels:  hook
react-use-countdown
React hook for countdown state.
Stars: ✭ 19 (-68.33%)
Mutual labels:  hook
Funchook
Hook function calls by inserting jump instructions at runtime
Stars: ✭ 253 (+321.67%)
Mutual labels:  hook
Use Image Color
🎨 A hook to grab a color palette from images. Render a skeleton color while your original image still loading.
Stars: ✭ 222 (+270%)
Mutual labels:  hook

react-media-hook

CircleCI npm version npm downloads

React Hook for Media Queries. Uses matchMedia API.

Installation

Install it with yarn:

yarn add react-media-hook

Or with npm:

npm i react-media-hook --save

Usage

Pass query to useMediaPredicate:

import React from "react";
import { useMediaPredicate } from "react-media-hook";

const Component = () => {
    const biggerThan400 = useMediaPredicate("(min-width: 400px)");
    
    return <div>
        {biggerThan400 && <button>SomeButton</button>}
    </div>
};

API

useMedia(query: string)

Returns undefined (for example, in Node.js environment where mathMedia is not defined), or object, simular to mathMedia(...) result:

{
    matches: boolean,
    media: string
}

useMediaPredicate(query: string)

Returns just true or false.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].