react 添加样式

react添加style样式

var style={
            border:'1px solid #000',
            background:'red',
            width:'200px'
        };
        var Divider=React.createClass({
            
            render:function(){
                return (
                    <div style={style}>
                        <h2>{this.props.children}</h2>
                    </div>
                )
            }
        });
        React.render(
            <Divider>questions</Divider>,
            document.body
        )

 

posted @ 2016-06-28 17:22  jinzhu4147  阅读(204)  评论(0编辑  收藏  举报