Hyperapp is an ultra lightweight (1kb), minimal, functional, JavaScript library for building UIs. It comes with a VDOM engine and state management without any dependencies.

In this lesson, we learn how to use JSX with Hyperapp. By installing a Babel plugin, we can instruct it to transpile JSX to Hyperapp's h method for a better developer experience.

install:

npm i -D babel-plugin-transform-react-jsx

.babelrc file:

{
"plugins": [
["transform-react-jsx", { "pragma": "h" }]
],
"presets": [
"env"
]
}
import { h, app } from 'hyperapp'

const view = () => (
<div>
<h1>Hyperapp is sweet!</h1>
</div>
) const main = app({}, {}, view, document.body)

最新文章

  1. Torch 网络层 参数的初始化问题
  2. 尝试HTML + JavaScript 编写Windows App
  3. webpack入门(一)——webpack 介绍
  4. 怎么理解Android版本兼容???
  5. Nginx在安装过程经常出现的问题
  6. 模式匹配KMP算法
  7. [ZZ] HD7970GE vs GTX770
  8. zepto和jquery的区别,zepto的不同使用8条小结 会JS就会zepto
  9. [译]Java Thread Sleep示例
  10. iPad知识点记录
  11. 从一个模板函数聊聊模板函数里面如何获得T的名字
  12. 基于bootstrap的轮播广告页,带图片和文字
  13. 阿里云CENTOS服务器挂载数据盘
  14. c中关于#与##的简易使用
  15. Linux块设备加密之dm-crypt分析
  16. promise用法十道题
  17. Mysql数据库改名
  18. request.getRequestDispatcher(&quot;&quot;).forward()中文乱码
  19. Cable master---poj1064(二分|卡精度)
  20. 树链剖分-点的分治(链的点的个数为k的点对数)

热门文章

  1. Codeforces Round #260 (Div. 1)——Civilization
  2. unity3d Pathfinding插件使用
  3. 21.QT二进制文件
  4. pyspider architecture--官方文档
  5. form&amp;method【POST~GET】
  6. T7316 yyy的最大公约数(者)
  7. C语言“%”运算符
  8. UVa 424 Integer Inquiry 【大数相加】
  9. Unity 动画系统(Mecanim) 术语及翻译 表格
  10. 树莓派使用samba