1 Star 0 Fork 0

Bo/react-from-zero

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
15-simple-integration.html 1.29 KB
一键复制 编辑 原始数据 按行查看 历史
<!doctype html>
<title>15 Simple Integration - React From Zero</title>
<script src="https://unpkg.com/react@16.4.0/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16.4.0/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<script src="https://unpkg.com/moment@2.18.1/min/moment.min.js">
// Most of the time we have to use third party libraries
// in our applications. Here we integrate a simple one
// for date handling and use it with React. It doesn"t
// use the DOM so it can be integrated fairly easy.
</script>
<div id="app"></div>
<script type="text/babel">
// Simple libraries that are called synchronous can used
// directly in JSX with the help of {}, since they are
// just function calls
var DateToday = function() {
return <span>{moment().format("DD.MM.YYYY")}</span>
}
var tomorrow = moment().add(1, "day")
// Nothing exciting happening here, just calling the library
// and displaying its return values. First with some
// elements, then used inside of a component.
var reactElement =
<div>
<h1 style={{textAlign:"center"}}>
Tomorrow is {tomorrow.format("MMMM")} the {tomorrow.format("Do")}
</h1>
<DateToday/>
</div>
ReactDOM.render(reactElement, document.getElementById("app"))
</script>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/uyscuti/react-from-zero.git
git@gitee.com:uyscuti/react-from-zero.git
uyscuti
react-from-zero
react-from-zero
master

搜索帮助