[Hyperapp] Render Text with JSX in Hyperapp
2024-09-06 23:28:15
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)
最新文章
- Torch 网络层 参数的初始化问题
- 尝试HTML + JavaScript 编写Windows App
- webpack入门(一)——webpack 介绍
- 怎么理解Android版本兼容???
- Nginx在安装过程经常出现的问题
- 模式匹配KMP算法
- [ZZ] HD7970GE vs GTX770
- zepto和jquery的区别,zepto的不同使用8条小结 会JS就会zepto
- [译]Java Thread Sleep示例
- iPad知识点记录
- 从一个模板函数聊聊模板函数里面如何获得T的名字
- 基于bootstrap的轮播广告页,带图片和文字
- 阿里云CENTOS服务器挂载数据盘
- c中关于#与##的简易使用
- Linux块设备加密之dm-crypt分析
- promise用法十道题
- Mysql数据库改名
- request.getRequestDispatcher(";";).forward()中文乱码
- Cable master---poj1064(二分|卡精度)
- 树链剖分-点的分治(链的点的个数为k的点对数)
热门文章
- Codeforces Round #260 (Div. 1)——Civilization
- unity3d Pathfinding插件使用
- 21.QT二进制文件
- pyspider architecture--官方文档
- form&;method【POST~GET】
- T7316 yyy的最大公约数(者)
- C语言“%”运算符
- UVa 424 Integer Inquiry 【大数相加】
- Unity 动画系统(Mecanim) 术语及翻译 表格
- 树莓派使用samba