:shipit: 使用 React Context 的有用属性
…npm install react-context --saveWrap your top-most component with react-context.
var React = require('react');
var context = require('react-context');
var Root = React.createClass({
render() {
return
}
});
module.exports = context(Root);Pass it an array of types you want to subscribe to, or call it with no arguments to subscribe to all of them.
// Subscribe to scroll and adBlock
Child.contextTypes = context.subscribe(['scroll', 'adBlock']);
// Subscribe to every context
Child.contextTypes = context.subscribe();暂无开放 Issues,或尚未同步最近议题。