React function component

2780 단어 react
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>

좋은 웹페이지 즐겨찾기