Skip to content

Commit 0422160

Browse files
authored
Merge pull request #184 from hoangvanhoa1701/translate/react-without-jsx
feat: translate React Without JSX page
2 parents cb1b927 + 0c83675 commit 0422160

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

content/docs/react-without-jsx.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
id: react-without-jsx
3-
title: React Without JSX
3+
title: React Không Dùng JSX
44
permalink: docs/react-without-jsx.html
55
---
66

7-
JSX is not a requirement for using React. Using React without JSX is especially convenient when you don't want to set up compilation in your build environment.
7+
JSX không phải là một yêu cầu bắt buộc để sử dụng React. Sử dụng React mà không dùng JSX đặc biệt thuận tiện khi bạn không muốn thiết lập compilation trong môi trường build của bạn.
88

9-
Each JSX element is just syntactic sugar for calling `React.createElement(component, props, ...children)`. So, anything you can do with JSX can also be done with just plain JavaScript.
9+
Mỗi phần tử JSX chỉ là một syntactic sugar để gọi `React.createElement(component, props, ...children)`. Vì vậy, bất cứ điều gì bạn có thể làm với JSX thì cũng có thể thực hiện được chỉ với JavaScript đơn giản.
1010

11-
For example, this code written with JSX:
11+
Ví dụ, đoạn code này được viết bằng JSX:
1212

1313
```js
1414
class Hello extends React.Component {
@@ -23,7 +23,7 @@ ReactDOM.render(
2323
);
2424
```
2525

26-
can be compiled to this code that does not use JSX:
26+
có thể được biên dịch thành đoạn code bên dưới, không sử dụng JSX:
2727

2828
```js
2929
class Hello extends React.Component {
@@ -38,11 +38,11 @@ ReactDOM.render(
3838
);
3939
```
4040

41-
If you're curious to see more examples of how JSX is converted to JavaScript, you can try out [the online Babel compiler](babel://jsx-simple-example).
41+
Nếu bạn tò mò muốn xem thêm các ví dụ về cách JSX được chuyển đổi sang JavaScript, bạn có thể thử [trình biên dịch Babel online](babel://jsx-simple-example).
4242

43-
The component can either be provided as a string, as a subclass of `React.Component`, or a plain function.
43+
Component có thể được cung cấp dưới dạng một string, dưới dạng subclass của `React.Component` hoặc một function thuần túy.
4444

45-
If you get tired of typing `React.createElement` so much, one common pattern is to assign a shorthand:
45+
Nếu bạn cảm thấy mệt mỏi với việc gõ `React.createElement` quá nhiều, một pattern phổ biến là hãy gán cho một biến và dùng nó như dạng viết tắt:
4646

4747
```js
4848
const e = React.createElement;
@@ -53,7 +53,7 @@ ReactDOM.render(
5353
);
5454
```
5555

56-
If you use this shorthand form for `React.createElement`, it can be almost as convenient to use React without JSX.
56+
Nếu bạn sử dụng dạng viết tắt này cho `React.createElement`, thì việc sử dụng React mà không có JSX có thể rất thuận tiện.
5757

58-
Alternatively, you can refer to community projects such as [`react-hyperscript`](https://github.com/mlmorg/react-hyperscript) and [`hyperscript-helpers`](https://github.com/ohanhi/hyperscript-helpers) which offer a terser syntax.
58+
Ngoài ra, bạn có thể tham khảo các dự án cộng đồng như [`react-hyperscript`](https://github.com/mlmorg/react-hyperscript) [`hyperscript-helpers`](https://github.com/ohanhi/hyperscript-helpers) sẽ cung cấp cho bạn cú pháp ngắn gọn hơn.
5959

0 commit comments

Comments
 (0)