- Create React App 2 Quick Start Guide
- Brandon Richey
- 213字
- 2021-07-02 12:53:26
Wait, what is JSX?
You may not know what JSX is, but if you do, feel free to skip this. Otherwise, I'm going to provide a very quick summary for you!
To put it simply, JSX is just a mixture of JavaScript and HTML that functions essentially as a templating language. This is a bit of a simplified explanation; JSX is actually some smart syntax wrappers around calls to React.createElement, but put together in a way that more closely resembles HTML. This way, we can write interface code that is incredibly similar to HTML, which allows developers, designers, and others to work with our code (assuming they're already comfortable working with HTML), but we also get access to a few extra features since it is a JavaScript -based templating language.
The first bit of functionality that we get is that we can actually embed any JavaScript statements inside of any JSX by wrapping it in curly brackets! A gotcha to this, though, is that we need to remember that JSX is JavaScript first, and as a result there are some words and syntax here and there are are reserved (class being the prime example of this), so there are specific variations you'll need to use when writing JSX (such as className).
- 數(shù)據(jù)庫系統(tǒng)原理及MySQL應(yīng)用教程(第2版)
- 零基礎(chǔ)玩轉(zhuǎn)區(qū)塊鏈
- Ext JS Data-driven Application Design
- 樂高機(jī)器人設(shè)計技巧:EV3結(jié)構(gòu)設(shè)計與編程指導(dǎo)
- Java開發(fā)入行真功夫
- SEO實(shí)戰(zhàn)密碼
- Lua程序設(shè)計(第4版)
- FLL+WRO樂高機(jī)器人競賽教程:機(jī)械、巡線與PID
- Mastering Business Intelligence with MicroStrategy
- HTML 5與CSS 3權(quán)威指南(第3版·上冊)
- C語言程序設(shè)計實(shí)訓(xùn)教程與水平考試指導(dǎo)
- Practical Microservices
- Python趣味編程與精彩實(shí)例
- 計算機(jī)應(yīng)用基礎(chǔ)(第二版)
- PHP Microservices