Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

react-context

> 编程语言
Open source

:shipit: Helpful Properties with React Context

194 stars0 likes1 views
WebsiteGitHub

About

:shipit: Helpful Properties with React Context

React Context

  • Engagement Properties - AdBlock and Focus
  • Display Properties - Density, Scroll, Width and Height
  • Device Properties - Language, OS, Browser and Browser Version
…

Installation & Usage

bash
npm install react-context --save

Wrap Root

Wrap your top-most component with react-context.

javascript
var React = require('react');
var context = require('react-context');

var Root = React.createClass({
  render() {
    return 

  }
});

module.exports = context(Root);

Set Types

Pass it an array of types you want to subscribe to, or call it with no arguments to subscribe to all of them.

javascript
// Subscribe to scroll and adBlock
Child.contextTypes = context.subscribe(['scroll', 'adBlock']);

// Subscribe to every context
Child.contextTypes = context.subscribe();

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

JavaScript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言