react component分类

2017-08-03  本文已影响42人  mengxr


const PropTypes = require('prop-types');

const Button = ({children}, context) =>
  <button style={{background: context.color}}>
    {children}
  </button>;

Button.contextTypes = {color: PropTypes.string};
上一篇 下一篇

猜你喜欢

热点阅读