React email&&

WEB前端 waitig 573℃ 百度已收录 0评论
<html>
  <head>
      <title>Document</title>
      <script src="../react.js"></script>
      <script src="../react-dom.js"></script>
      <!-- //引用资源,JSX转HTML -->
      <script src="http://cdn.bootcss.com/babel-core/5.8.38/browser.min.js"></script>
  </head>

  <body>
      <div id="reactContainer"/>

      <script type="text/babel">
        function Mailbox(props) {
          const unreadMessages = props.unreadMessages
          return (
            <div>
              <h1>Hello</h1>
              {unreadMessages.length > 0 &&
                <h2>
                  You have {unreadMessages.length} unread message.
                </h2>
              }
            </div>
          )
        }

        const unreadMessages = ['a', 'b', 'c']
        ReactDOM.render(
          <Mailbox unreadMessages={unreadMessages}/>,
          document.getElementById('reactContainer')
        )
      </script>
  </body>
</html>

本文由【waitig】发表在等英博客
本文固定链接:React email&&
欢迎关注本站官方公众号,每日都有干货分享!
等英博客官方公众号
点赞 (0)分享 (0)