// less
require (‘./static/less/index.less‘)
// 核心
var React = require(‘react‘)
var ReactDom = require(‘react-dom‘)
var ReactRouter = require(‘react-router-dom‘)
var Router = ReactRouter.BrowserRouter
var Route = ReactRouter.Route
var Link = ReactRouter.Link
var CreateClass = require(‘create-react-class‘)
var PropTypes = require(‘prop-types‘)
var Ajax = require(‘dollarphp-ajax‘)
// 创建组件
var Index = CreateClass({
render:function(){
return (
<Head>
<div>
hello world
</div>
</Head>
)
}
})
var Head = CreateClass({
render:function(){
return (
<div>
{this.props.children}
</div>
)
}
})
// 渲染
ReactDom.render(
<Index/>,
document.getElementById(‘app‘)
)
原文地址:http://blog.51cto.com/12173069/2112503
时间: 2024-10-07 05:47:06