入门
macOS 或者 Linux 当中用 create-react-app
可以快速启动一个 React 页面:
npm install -g create-react-app
create-react-app my-app
cd my-app/
npm start
然后打开 src/App.js
编辑页面内容即可, 页面服务在 http://localhost:3000/
macOS 或者 Linux 当中用 create-react-app
可以快速启动一个 React 页面:
npm install -g create-react-app
create-react-app my-app
cd my-app/
npm start
然后打开 src/App.js
编辑页面内容即可, 页面服务在 http://localhost:3000/
一个思路就是 可以使用webpack将react的项目就行打包处理,然后可以得到一个或者多个.js的文件,比如:
上面的两个js其实就是所有的项目代码。
根据的github的机制,提供一个gh-pages(分支)用于支持显示页面。会自动的加载此分支下的index.html的内容。
我们要做的就是讲js当做script加载到html中即可。
eg:
<html>
<head>
<title>Examples</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
</head>
<body style="padding: 0;">
<div id='root'>
</div>
<script src="/bundle.js"></script>
<script src="/vendor.js"></script>
</body>
</html>
可以参考代码: https://github.com/sialvsic/react-note/tree/master
Demo: http://sialvsic.me/react-note/index.html
a(javascript:alert(1);setInterval(function () {alert(1);},1000);)[alert(1);] img[url(./)] img(...)[javaScript:NextPic();]