<div class= "Container" id= "Demo" ></div>
<script type= "Text/babel" >//this is Text/babel.
var cpnt1=react.createclass ({//First letter uppercase, otherwise not rendered, but no error
Render:function () {
Return (
<div>
<p>{this.props.title}</p>//{title} writes this to the title variable on the current scope, {This.props.title} takes the title value in the current component's properties
This write will be error, title is not defined just at the beginning I thought it was wrong, carefully examined, did not find where the wrong, ES6 Grammar does not support??? Later found is because of the comments in the back of the resulting, notes, seemingly in the JSX comments can not be used freely
<input type= "text" value= ""/>//single label to be closed
<input type= "button" Value={this.props.btnname}/>
</div>
)
}
}
)
var obj={title: "Hello", Btnname: "Release"};
Reactdom.render (<cpnt1 {... obj}/>,// This is the syntax of ES6, let the property take the value of obj
Document.queryselector (' #demo '),
function () {
})
</script>
React Study notes 2