Skip to content

Commit 6ebb04d

Browse files
seognilQC-L
authored andcommitted
docs(cn): translate content/warnings/legacy-factories.md into Chinese (#113)
1 parent 5cb30a9 commit 6ebb04d

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

content/warnings/legacy-factories.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
---
2-
title: React Element Factories and JSX Warning
2+
title: 警告:有关 React Element 工厂和 JSX
33
layout: single
44
permalink: warnings/legacy-factories.html
55
---
66

7-
You probably came here because your code is calling your component as a plain function call. This is now deprecated:
7+
你能到这个页面很可能是因为:你的代码把你的组件直接作为普通的函数来调用。这个方式现在被废弃了:
88

99
```javascript
1010
var MyComponent = require('MyComponent');
1111

1212
function render() {
13-
return MyComponent({ foo: 'bar' }); // WARNING
13+
return MyComponent({ foo: 'bar' }); // 警告
1414
}
1515
```
1616

1717
## JSX {#jsx}
1818

19-
React components can no longer be called directly like this. Instead [you can use JSX](/docs/jsx-in-depth.html).
19+
React 组件现在不再能像这样直接被调用。取而代之的,[你可以使用 JSX](/docs/jsx-in-depth.html)
2020

2121
```javascript
2222
var React = require('react');
@@ -27,9 +27,9 @@ function render() {
2727
}
2828
```
2929

30-
## Without JSX {#without-jsx}
30+
## 不用 JSX {#without-jsx}
3131

32-
If you don't want to, or can't use JSX, then you'll need to wrap your component in a factory before calling it:
32+
如果你不希望、或者是不能使用 JSX,那么你需要把你的组件包装成工厂函数然后再调用它:
3333

3434
```javascript
3535
var React = require('react');
@@ -40,11 +40,11 @@ function render() {
4040
}
4141
```
4242

43-
This is an easy upgrade path if you have a lot of existing function calls.
43+
当你有一大堆现存的函数调用的时候,这样做是一个简单的升级方式。
4444

45-
## Dynamic components without JSX {#dynamic-components-without-jsx}
45+
## 不使用 JSX 的动态组件 {#dynamic-components-without-jsx}
4646

47-
If you get a component class from a dynamic source, then it might be unnecessary to create a factory that you immediately invoke. Instead you can just create your element inline:
47+
如果从动态来源取得组件类,那么就不需要创建立即调用的工厂函数。你可以改用内联的方式创建你的元素:
4848

4949
```javascript
5050
var React = require('react');
@@ -54,6 +54,6 @@ function render(MyComponent) {
5454
}
5555
```
5656

57-
## In Depth {#in-depth}
57+
## 深入 {#in-depth}
5858

59-
[Read more about WHY we're making this change.](https://gist.github.com/sebmarkbage/d7bce729f38730399d28)
59+
[查阅更多关于**为什么**我们做出这个变动。](https://gist.github.com/sebmarkbage/d7bce729f38730399d28)

0 commit comments

Comments
 (0)