---restore content starts---
1, Reactdom.render () react The most basic method, used to convert the template to HTML language, and insert the specified DOM node to insert the H tag into the example node 2, the HTML language is written directly in the JavaScript language, Without any quotation marks, it is the syntax of JSX. 3. Create the component. React.createclass ({}) -----Receive an object property render returns the defined component render: Reactdom.render (component, where to place the component (position), A callback after rendering is complete) Full code: Var hellomessage=react.createclass ({ alertme:function () { alert ("You click me!!!"); }, render:function () { return (
Note:The first letter must be capitalized when the component name is declared, if it is not renderedIf this error is reported in the console: Failed to locate workspace file mapped to URL file:///D:/%E4%B8%AA%E4%BA%BA%E6%96%87%E4%BB%B6%E5%A4% b9/desktop/reactdemoself/demo1/embedded from source Map file:///D:/%E4%B8%AA%E4%BA%BA%E6%96%87%E4%BB%B6%E5%A4%B9/ Desktop/reactdemoself/demo1/index2.htmlThe reason is that your parent folder has Chinese characters, so you don't report such mistakes in English.
---restore content ends---
Reactnative Essay One