TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

JSX in detail

129 点作者 Pishky超过 7 年前

10 条评论

whitefish超过 7 年前
Note that JSX is not limited to React. You can use JSX (or TSX in the case of Typescript) as a better replacement for Moustache or Handlebars. See here: <a href="https:&#x2F;&#x2F;github.com&#x2F;wisercoder&#x2F;uibuilder" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;wisercoder&#x2F;uibuilder</a>
评论 #15203347 未加载
danenania超过 7 年前
Has anyone else made the switch from JSX to hyperscript? JSX works well enough, but I love the consistency and composability of building views with plain old functions and data structures.
评论 #15198927 未加载
评论 #15200992 未加载
评论 #15200319 未加载
评论 #15198852 未加载
评论 #15199088 未加载
brochington超过 7 年前
Experimenting with JSX has introduced me to two language constructs: the Pragma, and the Macro. I know that these might seem a bit pedestrian to most folks, but they opened up my understanding of programming languages considerably. I am genuinely a bit surprised that the Javascript community hasn&#x27;t played around more with the possibilities that both can offer.
评论 #15198358 未加载
评论 #15199015 未加载
评论 #15202150 未加载
评论 #15198940 未加载
viebel超过 7 年前
Here is the author of the Klipse plugin[1] that powers the interactive code snippets.<p>I&#x27;ve opened a github issue[2] to suggest to integrate the Klipse plugin on react.js official documentation. If you like the code interactivity, feel free to express yourself on the github issue[2].<p>1: <a href="https:&#x2F;&#x2F;github.com&#x2F;viebel&#x2F;klipse" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;viebel&#x2F;klipse</a> 2: <a href="https:&#x2F;&#x2F;github.com&#x2F;facebook&#x2F;react&#x2F;issues&#x2F;10646" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;facebook&#x2F;react&#x2F;issues&#x2F;10646</a>
haukur超过 7 年前
Another good resource to learn about JSX (by the author of Preact): <a href="https:&#x2F;&#x2F;jasonformat.com&#x2F;wtf-is-jsx&#x2F;" rel="nofollow">https:&#x2F;&#x2F;jasonformat.com&#x2F;wtf-is-jsx&#x2F;</a>
hzoo超过 7 年前
Gave a talk at React Rally that goes over this briefly. <a href="https:&#x2F;&#x2F;github.com&#x2F;hzoo&#x2F;so-how-does-babel-even-work" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;hzoo&#x2F;so-how-does-babel-even-work</a>, and a basic version of the actual Babel transform: <a href="http:&#x2F;&#x2F;astexplorer.net&#x2F;#&#x2F;gist&#x2F;ccb201a61db3d581c8be3161bf78065d&#x2F;b4651fda44c10da9d252896809caa6439afb2a16" rel="nofollow">http:&#x2F;&#x2F;astexplorer.net&#x2F;#&#x2F;gist&#x2F;ccb201a61db3d581c8be3161bf7806...</a>
thomasfl超过 7 年前
Hyperscript markup looks like a nice replacement for JSX. The source for hyperscript-react is 50 lines of code, including comments and empty lines, so it&#x27;s fairly easy to learn:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;mlmorg&#x2F;react-hyperscript&#x2F;blob&#x2F;master&#x2F;index.js" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mlmorg&#x2F;react-hyperscript&#x2F;blob&#x2F;master&#x2F;inde...</a>
评论 #15199464 未加载
评论 #15199934 未加载
cstrat超过 7 年前
Thanks for posting this, it&#x27;s a good read so far.<p>I have been using JSX quite a bit and this is helping me get a better understanding.
omegote超过 7 年前
It&#x27;s funny how, for years, we&#x27;ve been trying to get away from HTML mixed with code (specially in spaguetti PHP), just to get back to something similar again.
评论 #15199689 未加载
评论 #15199661 未加载
评论 #15200225 未加载
评论 #15200166 未加载
评论 #15199694 未加载
评论 #15199762 未加载
评论 #15199726 未加载
评论 #15200173 未加载
评论 #15200136 未加载
评论 #15199649 未加载
keymone超过 7 年前
<a href="https:&#x2F;&#x2F;github.com&#x2F;lantiga&#x2F;react.hiccup" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;lantiga&#x2F;react.hiccup</a>