React Hello world
来源:互联网 发布:win7公用网络点不了 编辑:程序博客网 时间:2024/06/02 02:05
<html> <head> <title>hello world</title> </head> <body> <div id="reactContainer"></div> <script src="./react.js"></script> <script src="./react-dom.js"></script> <script> var hello = React.createClass({ render: () => React.createElement('h1', null, 'hello world') }) //创建组件类 ReactDOM.render( React.createElement(hello, null), //用组件创建一个元素 document.getElementById('reactContainer') ) </script> </body></html>
React.createClass
它的作用是注册一个组件类
ReactDOM.render()
ReactDOM.render是React的最基本方法,用于将模板转为HTML语言,并插入指定的DOM节点。
阅读全文
0 0
- Hello world React
- react入门,Hello World
- react之“hello world”
- React Hello,World
- React 2 hello world
- React Hello world
- React.js hello world
- 【React】热热身:Hello World
- 初探react-native Hello World
- React Native 之 Hello World
- React Native版Hello World
- React-Native之Hello World
- react native 之hello world
- Topic 1: hello world for react-native
- react native 学习笔记之hello world
- react native的hello world项目
- React Native之编写Hello World
- react-native构建android hello world踩坑记
- Mybatis_day01
- jsp中request的常见使用方法
- jsp/servlet第一章tomcat
- 自己实现一个JPA中的分页
- SSL/TLS握手过程
- React Hello world
- textView设置行间距
- Linux 系统如何查看版本信息
- 计算机组成原理实验二:四位补码运算器
- 连咸鱼都能学会的Java多线程中的内存模型
- HDU-1159 Common Subsequence (线性dp 最长公共子串)
- 【QT编程】可以拍照录像的APP
- 关于ARM子程序跳转和中断跳转的流水线问题
- 对学习Java这门语言的感想