Skip to content

Commit e7cb130

Browse files
authored
Merge pull request #64 from reactjs/sync-fa5e6e7a
Sync with reactjs.org @ fa5e6e7
2 parents 4181d98 + d0477cd commit e7cb130

File tree

6 files changed

+57
-14
lines changed

6 files changed

+57
-14
lines changed

content/community/conferences.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,10 @@ March 30 - 31, 2020 in San Francisco, CA
1818
[Website](https://www.reactathon.com) - [Twitter](https://twitter.com/reactathon) - [Facebook](https://www.facebook.com/events/575942819854160/)
1919

2020
### React Summit Amsterdam 2020 {#react-summit-2020}
21-
April 15-17, 2020 in Amsterdam, The Netherlands
21+
September 11, 2020 in Amsterdam, The Netherlands
2222

2323
[Website](https://reactsummit.com) - [Twitter](https://twitter.com/reactamsterdam) - [Facebook](https://www.facebook.com/reactamsterdam) - [Videos](https://youtube.com/c/ReactConferences)
2424

25-
### App.js Conf 2020 {#appjsonf2020}
26-
April 23 - 24, 2020 in Kraków, Poland
27-
28-
[Website](http://appjs.co/react) - [Twitter](https://twitter.com/appjsconf)
29-
3025
### React Day Bangalore 2020 {#react-day-bangalore-2020}
3126
April 25, 2020 in Bangalore, India
3227

content/docs/code-splitting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ import("./math").then(math => {
9797
When Webpack comes across this syntax, it automatically starts code-splitting
9898
your app. If you're using Create React App, this is already configured for you
9999
and you can [start using it](https://facebook.github.io/create-react-app/docs/code-splitting) immediately. It's also supported
100-
out of the box in [Next.js](https://github.com/zeit/next.js/#dynamic-import).
100+
out of the box in [Next.js](https://nextjs.org/docs/advanced-features/dynamic-import).
101101

102102
If you're setting up Webpack yourself, you'll probably want to read Webpack's
103103
[guide on code splitting](https://webpack.js.org/guides/code-splitting/). Your Webpack config should look vaguely [like this](https://gist.github.com/gaearon/ca6e803f5c604d37468b0091d9959269).

content/docs/faq-ajax.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,50 @@ class MyComponent extends React.Component {
8282
}
8383
}
8484
```
85+
86+
Here is the equivalent with [Hooks](https://reactjs.org/docs/hooks-intro.html):
87+
88+
```js
89+
function MyComponent() {
90+
const [error, setError] = useState(null);
91+
const [isLoaded, setIsLoaded] = useState(false);
92+
const [items, setItems] = useState([]);
93+
94+
// Note: the empty deps array [] means
95+
// this useEffect will run once
96+
// similar to componentDidMount()
97+
useEffect(() => {
98+
fetch("https://api.example.com/items")
99+
.then(res => res.json())
100+
.then(
101+
(result) => {
102+
setIsLoaded(true);
103+
setItems(result.items);
104+
},
105+
// Note: it's important to handle errors here
106+
// instead of a catch() block so that we don't swallow
107+
// exceptions from actual bugs in components.
108+
(error) => {
109+
setIsLoaded(true);
110+
setError(error);
111+
}
112+
)
113+
}, [])
114+
115+
if (error) {
116+
return <div>Error: {error.message}</div>;
117+
} else if (!isLoaded) {
118+
return <div>Loading...</div>;
119+
} else {
120+
return (
121+
<ul>
122+
{items.map(item => (
123+
<li key={item.name}>
124+
{item.name} {item.price}
125+
</li>
126+
))}
127+
</ul>
128+
);
129+
}
130+
}
131+
```

content/docs/forms.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ handleChange(event) {
7575
this.setState({value: event.target.value.toUpperCase()});
7676
}
7777
```
78+
Egy kontrollált komponensben a bemenet értékét mindig a React állapot vezérli. Habár ez azt jelenti, hogy egy kicsivel több kódot kell írnod, de így ezt az értéket több komponensnek is át tudod adni, vagy eseménykezelőkből a kezdeti állapotba állítani.
7879

7980
## A textarea címke {#the-textarea-tag}
8081

content/docs/strict-mode.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ Render phase lifecycles include the following class component methods:
9797

9898
Because the above methods might be called more than once, it's important that they do not contain side-effects. Ignoring this rule can lead to a variety of problems, including memory leaks and invalid application state. Unfortunately, it can be difficult to detect these problems as they can often be [non-deterministic](https://en.wikipedia.org/wiki/Deterministic_algorithm).
9999

100-
Strict mode can't automatically detect side effects for you, but it can help you spot them by making them a little more deterministic. This is done by intentionally double-invoking the following methods:
100+
Strict mode can't automatically detect side effects for you, but it can help you spot them by making them a little more deterministic. This is done by intentionally double-invoking the following functions:
101101

102-
* Class component `constructor` method
103-
* The `render` method
104-
* `setState` updater functions (the first argument)
105-
* The static `getDerivedStateFromProps` lifecycle
106-
* The `shouldComponentUpdate` method
102+
* Class component `constructor`, `render`, and `shouldComponentUpdate` methods
103+
* Class component static `getDerivedStateFromProps` method
104+
* Function component bodies
105+
* State updater functions (the first argument to `setState`)
106+
* Functions passed to `useState`, `useMemo`, or `useReducer`
107107

108108
> Note:
109109
>

examples/uncontrolled-components/input-type-file.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class FileInput extends React.Component {
66
this.fileInput = React.createRef();
77
}
88
handleSubmit(event) {
9-
// highlight-range{4}
9+
// highlight-range{3}
1010
event.preventDefault();
1111
alert(
1212
`Selected file - ${this.fileInput.current.files[0].name}`

0 commit comments

Comments
 (0)