React function component

component capital letter, single object

<html>
  <head>
      <title>Documenttitle>
      <script src="../react.js">script>
      <script src="../react-dom.js">script>
      <script src="http://cdn.bootcss.com/babel-core/5.8.38/browser.min.js">script>
  head>

  <body>
    <div id="demo">div>
    <script type="text/babel">
       function Welcome(props) {
         return <h1>Hello, {props.name}h1>
       }

       const element = <Welcome name="wlh"/>
       ReactDOM.render(
         element,
         document.getElementById('demo')
       )
    script>
  body>
html>

你可能感兴趣的:(react)