Skip to content

Commit 9a7d78b

Browse files
committed
Merge branch 'main' into 2013-06-05-why-react.md
2 parents c5ee12b + 5d8265c commit 9a7d78b

20 files changed

+283
-273
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.cache
22
.DS_STORE
33
.idea
4+
.history
45
node_modules
56
public
67
yarn-error.log

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# reactjs.org
1+
# vi.reactjs.org
22

3-
This repo contains the source code and documentation powering [reactjs.org](https://reactjs.org/).
3+
This repo contains the source code and documentation powering [vi.reactjs.org](https://reactjs.org/).
44

55
## Getting started
66

@@ -10,11 +10,11 @@ This repo contains the source code and documentation powering [reactjs.org](http
1010
1. Node: any 12.x version starting with v12.0.0 or greater
1111
1. Yarn: See [Yarn website for installation instructions](https://yarnpkg.com/lang/en/docs/install/)
1212
1. A fork of the repo (for any contributions)
13-
1. A clone of the [reactjs.org repo](https://github.com/reactjs/reactjs.org) on your local machine
13+
1. A clone of the [vi.reactjs.org repo](https://github.com/reactjs/vi.reactjs.org) on your local machine
1414

1515
### Installation
1616

17-
1. `cd reactjs.org` to go into the project root
17+
1. `cd vi.reactjs.org` to go into the project root
1818
1. `yarn` to install the website's npm dependencies
1919

2020
### Running locally
@@ -30,7 +30,7 @@ The documentation is divided into several sections with a different tone and pur
3030

3131
### Create a branch
3232

33-
1. `git checkout main` from any folder in your local `reactjs.org` repository
33+
1. `git checkout main` from any folder in your local `vi.reactjs.org` repository
3434
1. `git pull origin main` to ensure you have the latest main code
3535
1. `git checkout -b the-name-of-my-branch` (replacing `the-name-of-my-branch` with a suitable name) to create a branch
3636

@@ -51,7 +51,7 @@ The documentation is divided into several sections with a different tone and pur
5151

5252
1. `git add -A && git commit -m "My message"` (replacing `My message` with a commit message, such as `Fix header logo on Android`) to stage and commit your changes
5353
1. `git push my-fork-name the-name-of-my-branch`
54-
1. Go to the [reactjs.org repo](https://github.com/reactjs/reactjs.org) and you should see recently pushed branches.
54+
1. Go to the [vi.reactjs.org repo](https://github.com/reactjs/vi.reactjs.org) and you should see recently pushed branches.
5555
1. Follow GitHub's instructions.
5656
1. If possible, include screenshots of visual changes. A [Netlify](https://www.netlify.com/) build will also be automatically created once you make your PR so other people can see your change.
5757

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
title: JSFiddle Integration
2+
title: Tích hợp JSFiddle
33
author: [vjeux]
44
---
55

6-
[JSFiddle](https://jsfiddle.net) just announced support for React. This is an exciting news as it makes collaboration on snippets of code a lot easier. You can play around this **[base React JSFiddle](http://jsfiddle.net/vjeux/kb3gN/)**, fork it and share it! A [fiddle without JSX](http://jsfiddle.net/vjeux/VkebS/) is also available.
6+
[JSFiddle](https://jsfiddle.net) vừa mới thông báo hỗ trợ cho React. Đây là một tin thú vị vì nó giúp cho việc cộng tác với các đoạn code trở nên dễ dàng hơn rất nhiều. Bạn có thể làm việc với **[nền tảng React JSFiddle](http://jsfiddle.net/vjeux/kb3gN/)**, sửa đổi và chia sẻ nó! Một [fiddle không cần JSX](http://jsfiddle.net/vjeux/VkebS/) cũng đã có.
77

88

9-
<blockquote class="twitter-tweet" align="center"><p>React (by Facebook) is now available on JSFiddle. <a href="http://t.co/wNQf9JPv5u" title="http://facebook.github.io/react/">facebook.github.io/react/</a></p>&mdash; JSFiddle (@jsfiddle) <a href="https://twitter.com/jsfiddle/status/341114115781177344">June 2, 2013</a></blockquote>
9+
<blockquote class="twitter-tweet" align="center"><p>React (bởi Facebook) hiện đã có trên JSFiddle. <a href="http://t.co/wNQf9JPv5u" title="http://facebook.github.io/react/">facebook.github.io/react/</a></p>&mdash; JSFiddle (@jsfiddle) <a href="https://twitter.com/jsfiddle/status/341114115781177344">Ngày 2 tháng 6 năm 2013</a></blockquote>

content/blog/2013-07-26-react-v0-4-1.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@ title: "React v0.4.1"
33
author: [zpao]
44
---
55

6-
React v0.4.1 is a small update, mostly containing correctness fixes. Some code has been restructured internally but those changes do not impact any of our public APIs.
6+
React v0.4.1 là một thay đổi nhỏ, hầu hết bao gồm các bản sửa lỗi về tính đúng đắn. Một số đoạn mã đã được cấu trúc lại bên trong nhưng những thay đổi đó không ảnh hưởng đến bất kỳ API công khai nào của chúng tôi.
77

88

99
## React {#react}
1010

11-
* `setState` callbacks are now executed in the scope of your component.
12-
* `click` events now work on Mobile Safari.
13-
* Prevent a potential error in event handling if `Object.prototype` is extended.
14-
* Don't set DOM attributes to the string `"undefined"` on update when previously defined.
15-
* Improved support for `<iframe>` attributes.
16-
* Added checksums to detect and correct cases where server-side rendering markup mismatches what React expects client-side.
11+
* `setState` callback hiện đã có thể được thực thi trong phạm vi component của bạn.
12+
* `click` event hiện đã hoạt động trên Mobile Safari.
13+
* Ngăn lỗi tiềm ẩn trong xử lý sự kiện nếu `Object.prototype` được mở rộng.
14+
* Không đặt thuộc tính DOM thành chuỗi `"undefined"` trong lúc cập nhật khi được định nghĩa trước đó.
15+
* Cải thiện hỗ trợ cho các thuộc tính `<iframe>`.
16+
* Đã thêm checksum để phát hiện và sửa các trường hợp mà server-side hiển thị markup không khớp với những gì React mong đợi ở phía client-side.
1717

1818

1919
## JSXTransformer {#jsxtransformer}
2020

21-
* Improved environment detection so it can be run in a non-browser environment.
21+
* Cải thiện khả năng phát hiện môi trường để nó có thể chạy trong môi trường không có trình duyệt.
2222

2323

24-
[Download it now!](/downloads.html)
24+
[Tải xuống ngay bây giờ!](/downloads.html)

content/blog/2020-12-21-data-fetching-with-react-server-components.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
tiêu đề: "Giới thiệu Zero-Bundle-Size React Server Components"
3-
tác giả: [gaearon,laurentan,josephsavona,sebmarkbage]
2+
title: "Giới thiệu Zero-Bundle-Size React Server Components"
3+
author: [gaearon,laurentan,josephsavona,sebmarkbage]
44
---
55

66
2020 là một năm dài. Năm cũ sắp hết, chúng tôi muốn mang đến một cập nhật đặc biệt cho mùa lễ hội này, đó là nghiên cứu của chúng tôi về zero-bundle-size **React Server Components**.

content/blog/2021-06-08-the-plan-for-react-18.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,43 +11,43 @@ The React team is excited to share a few updates:
1111

1212
These updates are primarily aimed at maintainers of third-party libraries. If you’re learning, teaching, or using React to build user-facing applications, you can safely ignore this post. But you are welcome to follow the discussions in the React 18 Working Group if you're curious!
1313

14-
## What’s coming in React 18
14+
## What’s coming in React 18 {#whats-coming-in-react-18}
1515

1616
When it’s released, React 18 will include out-of-the-box improvements (like [automatic batching](https://github.com/reactwg/react-18/discussions/21)), new APIs (like [`startTransition`](https://github.com/reactwg/react-18/discussions/41)), and a [new streaming server renderer](https://github.com/reactwg/react-18/discussions/37) with built-in support for `React.lazy`.
1717

1818
These features are possible thanks to a new opt-in mechanism we’re adding in React 18. It’s called “concurrent rendering” and it lets React prepare multiple versions of the UI at the same time. This change is mostly behind-the-scenes, but it unlocks new possibilities to improve both real and perceived performance of your app.
1919

2020
If you've been following our research into the future of React (we don't expect you to!), you might have heard of something called “concurrent mode” or that it might break your app. In response to this feedback from the community, we’ve redesigned the upgrade strategy for gradual adoption. Instead of an all-or-nothing “mode”, concurrent rendering will only be enabled for updates triggered by one of the new features. In practice, this means **you will be able to adopt React 18 without rewrites and try the new features at your own pace.**
2121

22-
## A gradual adoption strategy
22+
## A gradual adoption strategy {#a-gradual-adoption-strategy}
2323

2424
Since concurrency in React 18 is opt-in, there are no significant out-of-the-box breaking changes to component behavior. **You can upgrade to React 18 with minimal or no changes to your application code, with a level of effort comparable to a typical major React release**. Based on our experience converting several apps to React 18, we expect that many users will be able to upgrade within a single afternoon.
2525

2626
We successfully shipped concurrent features to tens of thousands of components at Facebook, and in our experience, we've found that most React components “just work” without additional changes. We're committed to making sure this is a smooth upgrade for the entire community, so today we're announcing the React 18 Working Group.
2727

28-
## Working with the community
28+
## Working with the community {#working-with-the-community}
2929

3030
We’re trying something new for this release: We've invited a panel of experts, developers, library authors, and educators from across the React community to participate in our [React 18 Working Group](https://github.com/reactwg/react-18) to provide feedback, ask questions, and collaborate on the release. We couldn't invite everyone we wanted to this initial, small group, but if this experiment works out, we hope there will be more in the future!
3131

3232
**The goal of the React 18 Working Group is to prepare the ecosystem for a smooth, gradual adoption of React 18 by existing applications and libraries.** The Working Group is hosted on [GitHub Discussions](https://github.com/reactwg/react-18/discussions) and is available for the public to read. Members of the working group can leave feedback, ask questions, and share ideas. The core team will also use the discussions repo to share our research findings. As the stable release gets closer, any important information will also be posted on this blog.
3333

3434
For more information on upgrading to React 18, or additional resources about the release, see the [React 18 announcement post](https://github.com/reactwg/react-18/discussions/4).
3535

36-
## Accessing the React 18 Working Group
36+
## Accessing the React 18 Working Group {#accessing-the-react-18-working-group}
3737

3838
Everyone can read the discussions in the [React 18 Working Group repo](https://github.com/reactwg/react-18).
3939

4040
Because we expect an initial surge of interest in the Working Group, only invited members will be allowed to create or comment on threads. However, the threads are fully visible to the public, so everyone has access to the same information. We believe this is a good compromise between creating a productive environment for working group members, while maintaining transparency with the wider community.
4141

4242
As always, you can submit bug reports, questions, and general feedback to our [issue tracker](https://github.com/facebook/react/issues).
4343

44-
## How to try React 18 Alpha today
44+
## How to try React 18 Alpha today {#how-to-try-react-18-alpha-today}
4545

4646
New alphas are [regularly published to npm using the `@alpha` tag](https://github.com/reactwg/react-18/discussions/9). These releases are built using the most recent commit to our main repo. When a feature or bugfix is merged, it will appear in an alpha the following weekday.
4747

4848
There may be significant behavioral or API changes between alpha releases. Please remember that **alpha releases are not recommended for user-facing, production applications**.
4949

50-
## Projected React 18 release timeline
50+
## Projected React 18 release timeline {#projected-react-18-release-timeline}
5151

5252
We don't have a specific release date scheduled, but we expect it will take several months of feedback and iteration before React 18 is ready for most production applications.
5353

content/docs/addons-two-way-binding-helpers.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,25 @@ import LinkedStateMixin from 'react-addons-linked-state-mixin'; // ES6
1717
var LinkedStateMixin = require('react-addons-linked-state-mixin'); // ES5 with npm
1818
```
1919

20-
## Overview {#overview}
20+
## Tổng quan {#overview}
2121

22-
`LinkedStateMixin` is an easy way to express two-way binding with React.
22+
`LinkedStateMixin` là một cách đơn giản để thể hiện ràng buộc (binding) hai chiều với React..
2323

24-
In React, data flows one way: from owner to child. We think that this makes your app's code easier to understand. You can think of it as "one-way data binding."
24+
Trong React, dữ liệu chạy theo một chiều: từ cha sang con. Chúng tôi nghĩ rằng điều này làm cho code của bạn trong ứng dụng dễ hiểu hơn. Bạn có thể coi nó là "ràng buộc (binding) dữ liệu một chiều".
2525

26-
However, there are lots of applications that require you to read some data and flow it back into your program. For example, when developing forms, you'll often want to update some React `state` when you receive user input. Or perhaps you want to perform layout in JavaScript and react to changes in some DOM element size.
26+
Tuy nhiên, có rất nhiều trường hợp ứng dụng yêu cầu bạn đọc một số dữ liệu đầu vào và đổ nó quay lại chương trình của bạn. Ví dụ: khi tạo forms, bạn thường muốn cập nhật một số `state` của React khi nhận được thông tin đầu vào của người dùng. Hoặc có lẽ bạn muốn thực hiện layout trong JavaScript react sẽ thay đổi một số kích thước phần tử DOM.
2727

28-
In React, you would implement this by listening to a "change" event, read from your data source (usually the DOM) and call `setState()` on one of your components. "Closing the data flow loop" explicitly leads to more understandable and easier-to-maintain programs. See [our forms documentation](/docs/forms.html) for more information.
28+
Trong React, bạn sẽ triển khai điều này bằng cách lắng nghe sự kiện "event", đọc từ nguồn dữ liệu của bạn (thường là DOM) và gọi `setState()` trên một trong các components. "Dừng vòng lặp dữ liệu" cho ra các chương trình dễ hiểu hơn và dễ bảo trì hơn. Xem [our forms documentation](/docs/forms.html) để biết thêm chi tiết.
2929

30-
Two-way binding -- implicitly enforcing that some value in the DOM is always consistent with some React `state` -- is concise and supports a wide variety of applications. We've provided `LinkedStateMixin`: syntactic sugar for setting up the common data flow loop pattern described above, or "linking" some data source to React `state`.
30+
Ràng buộc hai chiều -- ngầm thực thi rằng một số giá trị trong DOM luôn nhất quán với một số khác trong React `state` -- ngắn gọn và hỗ trợ nhiều ứng dụng. Chúng tôi đã cung cấp `LinkedStateMixin`: cú pháp để thiết lập mẫu vòng lặp luồng dữ liệu chung được mô tả ở trên, hoặc "kết nối" một số nguồn dữ liệu tới React `state`.
3131

3232
> Note:
3333
>
34-
> `LinkedStateMixin` is just a thin wrapper and convention around the `onChange`/`setState()` pattern. It doesn't fundamentally change how data flows in your React application.
34+
> `LinkedStateMixin` chỉ là một lớp vỏ và quy ước xung quanh `onChange`/`setState()`. Về cơ bản, nó không thay đổi cách dữ liệu hoạt động trong ứng dụng React của bạn.
3535
36-
## LinkedStateMixin: Before and After {#linkedstatemixin-before-and-after}
36+
## LinkedStateMixin: Trước và sau {#linkedstatemixin-before-and-after}
3737

38-
Here's a simple form example without using `LinkedStateMixin`:
38+
Đây là một ví dụ về biểu mẫu đơn giản mà không cần sử dụng `LinkedStateMixin`:
3939

4040
```javascript
4141
var createReactClass = require('create-react-class');
@@ -54,7 +54,7 @@ var NoLink = createReactClass({
5454
});
5555
```
5656

57-
This works really well and it's very clear how data is flowing, however, with a lot of form fields it could get a bit verbose. Let's use `LinkedStateMixin` to save us some typing:
57+
Điều này thực sự hoạt động tốt và rất rõ ràng về cách dữ liệu đang hoạt động, tuy nhiên, với nhiều trường biểu mẫu, nó có thể hơi dài dòng. Hãy dùng `LinkedStateMixin` để tiết kiệm thời gian viết:
5858

5959
```javascript{4,9}
6060
var createReactClass = require('create-react-class');
@@ -70,18 +70,18 @@ var WithLink = createReactClass({
7070
});
7171
```
7272

73-
`LinkedStateMixin` adds a method to your React component called `linkState()`. `linkState()` returns a `valueLink` object which contains the current value of the React state and a callback to change it.
73+
`LinkedStateMixin` thêm một phương thức vào thành phần React của bạn được gọi là `linkState()`. `linkState()` trả về một `valueLink` đối tượng chứa giá trị hiện tại của React và một lệnh gọi lại để thay đổi trạng thái của nó.
7474

75-
`valueLink` objects can be passed up and down the tree as props, so it's easy (and explicit) to set up two-way binding between a component deep in the hierarchy and state that lives higher in the hierarchy.
75+
`valueLink` object có thể được đưa lên và xuống "tree" làm props, vì vậy nó dễ dàng (và rõ ràng) dùng để thiết lập ràng buộc hai chiều giữa một thành phần nằm sâu trong hệ thống phân cấp và trạng thái tồn tại cao hơn trong hệ thống phân cấp.
7676

77-
Note that checkboxes have a special behavior regarding their `value` attribute, which is the value that will be sent on form submit if the checkbox is checked (defaults to `on`). The `value` attribute is not updated when the checkbox is checked or unchecked. For checkboxes, you should use `checkedLink` instead of `valueLink`:
77+
Lưu ý rằng checkboxes có một hình thức đặc biệt liên quan đến thuộc tính `value`, là giá trị sẽ được truyền đi khi gửi biểu mẫu nếu checkboxes được chọn (mặc định là `on`). Thuộc tính `value` không được cập nhật khi hộp kiểm được chọn hoặc bỏ chọn. Đối với checkboxes, bạn nên dùng `checkedLink` thay cho `valueLink`:
7878
```
7979
<input type="checkbox" checkedLink={this.linkState('booleanValue')} />
8080
```
8181

8282
## Under the Hood {#under-the-hood}
8383

84-
There are two sides to `LinkedStateMixin`: the place where you create the `valueLink` instance and the place where you use it. To prove how simple `LinkedStateMixin` is, let's rewrite each side separately to be more explicit.
84+
Có hai mặt trong `LinkedStateMixin`: nơi bạn tạo ra `valueLink` và nơi bạn sử dụng nó. Để chứng minh một cách đơn giản `LinkedStateMixin` là gì, hãy viết lại từng cái một để rõ ràng hơn.
8585

8686
### valueLink Without LinkedStateMixin {#valuelink-without-linkedstatemixin}
8787

@@ -105,7 +105,7 @@ var WithoutMixin = createReactClass({
105105
});
106106
```
107107

108-
As you can see, `valueLink` objects are very simple objects that just have a `value` and `requestChange` prop. And `LinkedStateMixin` is similarly simple: it just populates those fields with a value from `this.state` and a callback that calls `this.setState()`.
108+
Bạn có thể thấy, đối tượng `valueLink` là những đối tượng rất đơn giản chỉ có `value` `requestChange`. Và `LinkedStateMixin` tương tự đơn giản như: nó chỉ điền vào các trường đó một giá trị từ `this.state` và một "callback" để gọi lại `this.setState()`.
109109

110110
### LinkedStateMixin Without valueLink {#linkedstatemixin-without-valuelink}
111111

@@ -128,4 +128,4 @@ var WithoutLink = createReactClass({
128128
});
129129
```
130130

131-
The `valueLink` prop is also quite simple. It simply handles the `onChange` event and calls `this.props.valueLink.requestChange()` and also uses `this.props.valueLink.value` instead of `this.props.value`. That's it!
131+
`valueLink` cũng khá đơn giản. Nó chỉ đơn giản là xử lý sự kiện `onChange` và gọi `this.props.valueLink.requestChange()` và cũng được dùng như `this.props.valueLink.value` thay cho `this.props.value`. Là vậy đó!

0 commit comments

Comments
 (0)