Skip to content

Sync with reactjs.org @ 519a3aec #123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 66 commits into from
Aug 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
986381c
Update an example to use a more accurate abbreviation. (#2201)
nirvdrum Aug 6, 2019
d818c19
fix 'Going Big with React' part 👻 .. (#2192)
3imed-jaberi Aug 7, 2019
ccdcf45
Update Footer link to
Aug 8, 2019
129df30
Profiler API docs (#2176)
Aug 8, 2019
4867765
Update website to v16.9 (#2210)
Aug 8, 2019
8be8bf9
Testing Docs (#2165)
Aug 8, 2019
c2d1794
Capitalization
gaearon Aug 8, 2019
a2a9051
Blog post for 16.9 (#2208)
gaearon Aug 8, 2019
cd27138
mod typo (#2213)
piglovesyou Aug 9, 2019
a7c8782
Update 2019-08-08-react-v16.9.0.md (#2211)
sophiebits Aug 9, 2019
3f6d60a
Update testing-recipes.md (#2212)
wyze Aug 9, 2019
4463b79
typo fix: 'although' (#2216)
mungojam Aug 9, 2019
4559e1c
Type fix 'Diffrent' ➡️ 'Different' (#2215)
Aug 9, 2019
164a82b
Fix a typo (#2214)
stsourlidakis Aug 9, 2019
911f5d1
[easy] copyedit testing-recipes.md (#2220)
Aug 9, 2019
29f7552
Fix typo in React v16.9.0 blog post (#2217)
mariusschulz Aug 9, 2019
53cce1d
Adds a TOC to testing-recipes.md (#2221)
Aug 9, 2019
12a8402
Update testing-recipes.md with English correct. (#2224)
tchaffee Aug 10, 2019
7382e4e
Link FAQ to testing recipes
gaearon Aug 10, 2019
181c499
Add a note about the codemod on the lifecycle warnings post (#2219)
Aug 10, 2019
17f4dee
Update languages.yml
tesseralis Aug 11, 2019
0b92a4d
Add React Conf Iran 2019 (#2228)
iammilaad Aug 12, 2019
a2b1f06
Add Joinville to meetups (#1828)
vitorebatista Aug 12, 2019
efc3958
Added missing function bracket in hooks-effect.md (#2207)
h-dong Aug 12, 2019
b839ec7
Update meetups.md (#2196)
jorgemasta Aug 12, 2019
6be7304
Update article.md (#2195)
httpJunkie Aug 12, 2019
e8ccec4
Update conferences.md
lex111 Aug 12, 2019
40ae16a
Mention Rollup (#2187)
mhienle Aug 12, 2019
975b4d2
Fix typo (#2183)
erwstout Aug 12, 2019
176e85f
Update meetups.md (#2178)
adriancodes Aug 12, 2019
8cd5737
Update componentDidCatch argument name like demo (#2180)
behnammodi Aug 12, 2019
6a1d86c
Links to React Redux hooks api (#2202)
Aug 12, 2019
1fc2859
Fetch latest babel link (#2153)
swarnava Aug 12, 2019
dea7ea1
Add React Knowledgeable (Singapore) to meetups (#2150)
wgao19 Aug 12, 2019
ddbd064
Add React Spring to Animation on Styling FAQ (#2147)
james-innes Aug 12, 2019
40a652c
Fix link to recipes (#2235)
vldmrkl Aug 12, 2019
a284b96
Add Penang, Malaysia meetup group (#2239)
jiantongc Aug 14, 2019
f4325d0
Change variable declaration of ‘newState’ in CodeEditor.js (#2241)
Pewww Aug 14, 2019
78270c5
Rephrase confusing documentation about TestRenderer.create return (#2…
TPXP Aug 15, 2019
0006b39
Updated babel installation instructions for Flow (#2248)
enero-o Aug 15, 2019
4c5ced7
added 2 react confernces (#2249)
EventHandlerPro Aug 15, 2019
a21a881
Update reference-profiler.md (#2247)
KirillPd Aug 15, 2019
59aac8b
Update articles.md (#2245)
httpJunkie Aug 15, 2019
fbb03df
Hooks intro: Remove message about React Native support (#2244)
MoOx Aug 15, 2019
e08553d
Remove React Week 2020 from conferences list
sophiebits Aug 15, 2019
af4db1d
Remove "highlight updates" from docs
gaearon Aug 15, 2019
3c7837a
React DevTools v4 blog post (#2199)
Aug 15, 2019
972d835
Hooks intro: Add reference to React Native support in 0.59 (#2250)
MoOx Aug 15, 2019
71ec859
Update hooks-faq.md with info for React Native (#1875)
jeremy-deutsch Aug 15, 2019
180cd22
Update 2019-08-15-new-react-devtools.md
gaearon Aug 16, 2019
68cedb3
Deemphasize Immutable.js in docs (#2253)
gaearon Aug 16, 2019
9de5e8c
Update 2015-09-02-new-react-developer-tools.md (#2252)
msal4 Aug 17, 2019
acbc049
Added Meetup Group (#2254)
sarabs3 Aug 17, 2019
de497e2
Clarify effect of ‘only’ language (#2264)
benfletcher Aug 18, 2019
74d047e
Include step to checkout v3 branch before building the devtools exten…
ThatTobMate Aug 20, 2019
aa85f15
Updated Render-Atlanta's Social Media (#2272)
Aug 20, 2019
4a7cc4a
fix links (#2257)
zcfan Aug 21, 2019
40596f8
docs: Add React Finland 2020 (#2275)
bebraw Aug 21, 2019
359c0d2
add the missing lang .. (#2284)
3imed-jaberi Aug 24, 2019
23b43b9
fix vietnamese trans. status .. (#2283)
3imed-jaberi Aug 24, 2019
e64cee2
add glitch react course (#2288)
alexkrolick Aug 25, 2019
c7f5645
Added Formik in the list of libraries, which use render props (#2287)
iamparnab Aug 25, 2019
ac9f9f1
fixing broken link (#2281)
lockround Aug 25, 2019
519a3ae
missed link in fast navigation added (#2289)
shdq Aug 26, 2019
e11794d
merging all conflicts
reactjs-translation-bot Aug 26, 2019
38a8a37
Resolve sync conflicts
Aug 26, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/blog/2015-09-02-new-react-developer-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ It contains a handful of new features, including:

## Installation {#installation}

Download the new devtools from the [Chrome Web Store](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi) and on [Mozilla Add-ons](https://addons.mozilla.org/en-US/firefox/addon/react-devtools/) for Firefox. If you're developing using React, we highly recommend installing these devtools.
Download the new devtools from the [Chrome Web Store](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi) and on [Firefox Add-ons](https://addons.mozilla.org/en-US/firefox/addon/react-devtools/) for Firefox. If you're developing using React, we highly recommend installing these devtools.

If you already have the Chrome extension installed, it should autoupdate within the next week. You can also head to `chrome://extensions` and click "Update extensions now" if you'd like to get the new version today. If you installed the devtools beta, please remove it and switch back to the version from the store to make sure you always get the latest updates and bug fixes.

Expand Down
9 changes: 9 additions & 0 deletions content/blog/2018-03-27-update-on-async-rendering.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ These lifecycle methods have often been misunderstood and subtly misused; furthe

We maintain over 50,000 React components at Facebook, and we don't plan to rewrite them all immediately. We understand that migrations take time. We will take the gradual migration path along with everyone in the React community.

If you don't have the time to migrate or test these components, we recommend running a ["codemod"](https://medium.com/@cpojer/effective-javascript-codemods-5a6686bb46fb) script that renames them automatically:

```bash
cd your_project
npx react-codemod rename-unsafe-lifecycles
```

Learn more about this codemod on the [16.9.0 release post.](https://reactjs.org/blog/2019/08/08/react-v16.9.0.html#renaming-unsafe-lifecycle-methods)

---

## Migrating from Legacy Lifecycles {#migrating-from-legacy-lifecycles}
Expand Down
5 changes: 5 additions & 0 deletions content/blog/2018-11-27-react-16-roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ author: [gaearon]
---

You might have heard about features like "Hooks", "Suspense", and "Concurrent Rendering" in the previous blog posts and talks. In this post, we'll look at how they fit together and the expected timeline for their availability in a stable release of React.

> An Update from August, 2019
>
> You can find an update to this roadmap in the [React 16.9 release blog post](/blog/2019/08/08/react-v16.9.0.html#an-update-to-the-roadmap).


## tl;dr {#tldr}

Expand Down
4 changes: 2 additions & 2 deletions content/blog/2019-02-06-react-v16.8.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Even while Hooks were in alpha, the React community created many interesting [ex

## Testing Hooks {#testing-hooks}

We have added a new API called `ReactTestUtils.act()` in this release. It ensures that the behavior in your tests matches what happens in the browser more closely. We recommend to wrap any code rendering and triggering updates to your components into `act()` calls. Testing libraries can also wrap their APIs with it (for example, [`react-testing-library`](https://github.com/kentcdodds/react-testing-library)'s `render` and `fireEvent` utilities do this).
We have added a new API called `ReactTestUtils.act()` in this release. It ensures that the behavior in your tests matches what happens in the browser more closely. We recommend to wrap any code rendering and triggering updates to your components into `act()` calls. Testing libraries can also wrap their APIs with it (for example, [`react-testing-library`](https://testing-library.com/react)'s `render` and `fireEvent` utilities do this).

For example, the counter example from [this page](/docs/hooks-effect.html) can be tested like this:

Expand Down Expand Up @@ -95,7 +95,7 @@ The calls to `act()` will also flush the effects inside of them.

If you need to test a custom Hook, you can do so by creating a component in your test, and using your Hook from it. Then you can test the component you wrote.

To reduce the boilerplate, we recommend using [`react-testing-library`](https://git.io/react-testing-library) which is designed to encourage writing tests that use your components as the end users do.
To reduce the boilerplate, we recommend using [`react-testing-library`](https://testing-library.com/react) which is designed to encourage writing tests that use your components as the end users do.

## Thanks {#thanks}

Expand Down
241 changes: 241 additions & 0 deletions content/blog/2019-08-08-react-v16.9.0.md

Large diffs are not rendered by default.

79 changes: 79 additions & 0 deletions content/blog/2019-08-15-new-react-devtools.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
title: "Introducing the New React DevTools"
author: [bvaughn]
---
We are excited to announce a new release of the React Developer Tools, available today in Chrome, Firefox, and (Chromium) Edge!

## What's changed?

A lot has changed in version 4!
At a high level, this new version should offer significant performance gains and an improved navigation experience.
It also offers full support for React Hooks, including inspecting nested objects.

![DevTools version 4 screenshot](../images/blog/devtools-v4-screenshot.png)

[Visit the interactive tutorial](https://react-devtools-tutorial.now.sh/) to try out the new version or [see the changelog](https://github.com/facebook/react/blob/master/packages/react-devtools/CHANGELOG.md#400-august-15-2019) for demo videos and more details.

## Which versions of React are supported?

**`react-dom`**

* `0`-`14.x`: Not supported
* `15.x`: Supported (except for the new component filters feature)
* `16.x`: Supported

**`react-native`**
* `0`-`0.61`: Not supported
* `0.62`: Will be supported (when 0.62 is released)

## How do I get the new DevTools?

React DevTools is available as an extension for [Chrome](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en) and [Firefox](https://addons.mozilla.org/en-US/firefox/addon/react-devtools/).
If you have already installed the extension, it should update automatically within the next couple of hours.

If you use the standalone shell (e.g. in React Native or Safari), you can install the new version [from NPM](https://www.npmjs.com/package/react-devtools):

```shell
npm install -g react-devtools@^4
```

## Where did all of the DOM elements go?

The new DevTools provides a way to filter components from the tree to make it easier to navigate deeply nested hierarchies.
Host nodes (e.g. HTML `<div>`, React Native `<View>`) are *hidden by default*, but this filter can be disabled:

![DevTools component filters](../images/blog/devtools-component-filters.gif)

## How do I get the old version back?

If you are working with React Native version 60 (or older) you can install the previous release of DevTools from NPM:

```shell
npm install --dev react-devtools@^3
```

For older versions of React DOM (v0.14 or earlier) you will need to build the extension from source:

```shell
# Checkout the extension source
git clone https://github.com/facebook/react-devtools

cd react-devtools

# Checkout the previous release branch
git checkout v3

# Install dependencies and build the unpacked extension
yarn install
yarn build:extension

# Follow the on-screen instructions to complete installation
```

## Thank you!

We'd like to thank everyone who tested the early release of DevTools version 4.
Your feedback helped improve this initial release significantly.

We still have many exciting features planned and feedback is always welcome!
Please feel free to open a [GitHub issue](https://github.com/facebook/react/issues/new?labels=Component:%20Developer%20Tools) or tag [@reactjs on Twitter](https://twitter.com/reactjs).
1 change: 1 addition & 0 deletions content/community/articles.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ permalink: community/articles.html
- [Timeline for Learning React](https://daveceddia.com/timeline-for-learning-react/) - Dave Ceddia's recommended timeline for learning React and the React ecosystem.
- [Simple React Development in 2017](https://hackernoon.com/simple-react-development-in-2017-113bd563691f) - Joshua Comeau's guide to showcase how easy it can be to start modern React development.
- [Visual Guide to State in React](https://daveceddia.com/visual-guide-to-state-in-react/) - Dave Ceddia's visual guide to React state.
- [The Hands-On Guide to Learning React Hooks](https://www.telerik.com/kendo-react-ui/react-hooks-guide/) - Eric Bishard's step-by-step guide to learning React Hooks.
18 changes: 17 additions & 1 deletion content/community/conferences.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ Do you know of a local React.js conference? Add it here! (Please keep the list c

## Upcoming Conferences {#upcoming-conferences}

### React Conf Iran 2019 {#react-conf-iran-2019}
August 29, 2019. Tehran, Iran.

[Website](https://reactconf.ir/) - [Twitter](https://twitter.com/reactconf_ir) - [Instagram](https://www.instagram.com/reactconf/)

### React Rally 2019 {#react-rally-2019}
August 22-23, 2019. Salt Lake City, USA.

Expand Down Expand Up @@ -75,7 +80,18 @@ February 27 & 28, 2020 in Sydney, Australia
### Render-Atlanta 2020 {#render-atlanta-2020}
May 4-6, 2020. Atlanta, GA, USA.

[Website](https://renderatl.com)
[Website](https://renderatl.com) - [Twitter](https://twitter.com/renderATL) - [Instagram](https://www.instagram.com/renderatl/) - [Facebook](https://www.facebook.com/renderatl/)

### React Finland 2020 {#react-finland-2020}
May 26-29 in Helsinki, Finland

[Website](https://react-finland.fi/) - [Twitter](https://twitter.com/ReactFinland)

### React Next 2020 {#react-next-2020}
June 15, 2020. Tel Aviv, Israel.

[Website](https://react-next.com/) - [Twitter](https://twitter.com/reactnext) - [Facebook](https://www.facebook.com/ReactNext2016/)


## Past Conferences {#past-conferences}

Expand Down
2 changes: 2 additions & 0 deletions content/community/courses.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ permalink: community/courses.html

## Free Courses {#free-courses}

- [Glitch: React Starter Kit](https://glitch.com/culture/react-starter-kit/) - A free, 5-part video course with interactive code examples that will help you learn React.

- [Codecademy: React 101](https://www.codecademy.com/learn/react-101) - Codecademy's introductory course for React.

- [Egghead.io: Start Learning React](https://egghead.io/courses/start-learning-react) - This series will explore the basic fundamentals of React to get you started.
Expand Down
10 changes: 10 additions & 0 deletions content/community/meetups.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Do you have a local React.js meetup? Add it here! (Please keep the list alphabet
## Brazil {#brazil}
* [Belo Horizonte](https://www.meetup.com/reactbh/)
* [Curitiba](https://www.meetup.com/pt-br/ReactJS-CWB/)
* [Joinville](https://www.meetup.com/pt-BR/React-Joinville/)
* [Rio de Janeiro](https://www.meetup.com/pt-BR/React-Rio-de-Janeiro/)
* [São Paulo](https://www.meetup.com/pt-BR/ReactJS-SP/)

Expand Down Expand Up @@ -68,6 +69,7 @@ Do you have a local React.js meetup? Add it here! (Please keep the list alphabet

## India {#india}
* [Bangalore](https://www.meetup.com/ReactJS-Bangalore/)
* [Chandigarh](https://www.meetup.com/Chandigarh-React-Developers/)
* [Chennai](https://www.meetup.com/React-Chennai/)
* [Delhi NCR](https://www.meetup.com/React-Delhi-NCR/)
* [Jaipur](https://www.meetup.com/JaipurJS-Developer-Meetup/)
Expand All @@ -78,6 +80,9 @@ Do you have a local React.js meetup? Add it here! (Please keep the list alphabet
## Israel {#israel}
* [Tel Aviv](https://www.meetup.com/ReactJS-Israel/)

## Malaysia {#malaysia}
* [Penang](https://www.facebook.com/groups/reactpenang/)

## Netherlands {#netherlands}
* [Amsterdam](https://www.meetup.com/React-Amsterdam/)

Expand Down Expand Up @@ -107,8 +112,12 @@ Do you have a local React.js meetup? Add it here! (Please keep the list alphabet
## Scotland (UK) {#scotland-uk}
* [Edinburgh](https://www.meetup.com/React-Scotland/)

## Singapore {#singapore}
* [Singapore - React Knowledgeable](https://reactknowledgeable.org/)

## Spain {#spain}
* [Barcelona](https://www.meetup.com/ReactJS-Barcelona/)
* [Canarias](https://www.meetup.com/React-Canarias/)

## Sweden {#sweden}
* [Goteborg](https://www.meetup.com/ReactJS-Goteborg/)
Expand All @@ -130,6 +139,7 @@ Do you have a local React.js meetup? Add it here! (Please keep the list alphabet
* [Leesburg, VA - ReactJS](https://www.meetup.com/React-NOVA/)
* [Los Angeles, CA - ReactJS](https://www.meetup.com/socal-react/)
* [Los Angeles, CA - React Native](https://www.meetup.com/React-Native-Los-Angeles/)
* [Miami, FL - ReactJS](https://www.meetup.com/React-Miami/)
* [Nashville, TN - ReactJS](https://www.meetup.com/NashReact-Meetup/)
* [New York, NY - ReactJS](https://www.meetup.com/NYC-Javascript-React-Group/)
* [New York, NY - React Ladies](https://www.meetup.com/React-Ladies/)
Expand Down
2 changes: 0 additions & 2 deletions content/community/nav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
title: Model Management
- id: data-fetching
title: Data Fetching
- id: testing
title: Testing
- id: ui-components
title: UI Components
- id: misc
Expand Down
13 changes: 0 additions & 13 deletions content/community/tools-testing.md

This file was deleted.

3 changes: 1 addition & 2 deletions content/community/videos.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ Facebook engineers Bill Fisher and Jing Chen talk about Flux and React at Forwar
### Going Big with React {#going-big-with-react}

Areeb Malik investigates how React performs in a high stress situation, and how it helped his team build safe code on a massive scale - (2014 - 0h31m).
[![going big with React](https://i.vimeocdn.com/video/481670116_650.jpg)]

<iframe title="Areeb Malik : Going big with React" width="650" height="366" src="https://www.youtube-nocookie.com/embed/9qcBlN6-qwY" frameborder="0" allowfullscreen></iframe>

### Rethinking Best Practices {#rethinking-best-practices}

Expand Down
6 changes: 4 additions & 2 deletions content/docs/addons-test-utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ it('potrafi wyrenderować i aktualizować licznik', () => {
});
```

Zwróć uwagę, że przesyłanie zdarzeń DOM działa tylko wtedy, gdy kontener jest umieszczony w `document`. Aby uniknąć powtarzania szablonowego kodu, możesz użyć biblioteki pomocniczej, jak na przykład [`react-testing-library`](https://github.com/kentcdodds/react-testing-library).
Zwróć uwagę, że przesyłanie zdarzeń DOM działa tylko wtedy, gdy kontener jest umieszczony w `document`. Aby uniknąć powtarzania szablonowego kodu, możesz użyć biblioteki pomocniczej, jak na przykład [React Testing Library](https://testing-library.com/react).

W [`przykładach`](/docs/testing-recipes.html) znajdziesz więcej szczegółów na temat zachowania funkcji `act()`, jak również przykłady jej użycia.

* * *

Expand All @@ -139,7 +141,7 @@ Jeśli przekażesz do tej funkcji atrapę komponentu (ang. *mocked component*),

> Uwaga:
>
> Funkcja `mockComponent()` jest przestarzała. Zamiast niej zalecamy używanie ["płytkiego renderowania"](/docs/shallow-renderer.html) (ang. *shallow rendering*) lub funkcji [`jest.mock()`](https://facebook.github.io/jest/docs/en/tutorial-react-native.html#mock-native-modules-using-jestmock).
> Funkcja `mockComponent()` jest przestarzała. Zamiast niej zalecamy używanie funkcji [`jest.mock()`](https://facebook.github.io/jest/docs/en/tutorial-react-native.html#mock-native-modules-using-jestmock).

* * *

Expand Down
2 changes: 1 addition & 1 deletion content/docs/code-splitting.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ permalink: docs/code-splitting.html
## Pakowanie {#bundling}

Większość reactowych aplikacji będzie "dołączała" swoje pliki poprzez narzędzia takie jak
[Webpack](https://webpack.js.org/) czy [Browserify](http://browserify.org/).
[Webpack](https://webpack.js.org/), [Rollup](https://rollupjs.org/) czy [Browserify](http://browserify.org/).
Pakowanie to proces śledzenia zaimportowanych plików i łączenia ich w pojedynczy plik tzw. "bundle" (pol. *paczka*).
Taka paczka może zostać umieszczona na stronie w celu załadowania całej aplikacji naraz.

Expand Down
2 changes: 1 addition & 1 deletion content/docs/codebase-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ Its source code is located in [`packages/react-reconciler`](https://github.com/f

### Event System {#event-system}

React implements a synthetic event system which is agnostic of the renderers and works both with React DOM and React Native. Its source code is located in [`packages/events`](https://github.com/facebook/react/tree/master/packages/events).
React implements a synthetic event system which is agnostic of the renderers and works both with React DOM and React Native. Its source code is located in [`packages/events`](https://github.com/facebook/react/tree/master/packages/react-events).

There is a [video with a deep code dive into it](https://www.youtube.com/watch?v=dRo_egw7tBc) (66 mins).

Expand Down
4 changes: 2 additions & 2 deletions content/docs/error-boundaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ class ErrorBoundary extends React.Component {
return { hasError: true };
}

componentDidCatch(error, info) {
componentDidCatch(error, errorInfo) {
// You can also log the error to an error reporting service
logErrorToMyService(error, info);
logErrorToMyService(error, errorInfo);
}

render() {
Expand Down
2 changes: 1 addition & 1 deletion content/docs/faq-styling.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ _Note that this functionality is not a part of React, but provided by third-part

### Can I do animations in React? {#can-i-do-animations-in-react}

React can be used to power animations. See [React Transition Group](https://reactcommunity.org/react-transition-group/) and [React Motion](https://github.com/chenglou/react-motion), for example.
React can be used to power animations. See [React Transition Group](https://reactcommunity.org/react-transition-group/) and [React Motion](https://github.com/chenglou/react-motion) or [React Spring](https://github.com/react-spring/react-spring), for example.
1 change: 1 addition & 0 deletions content/docs/hooks-effect.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ function Example() {
useEffect(() => {
document.title = `Kliknięto ${count} razy`;
});
}
```

Deklarujemy zmienną stanu `count`, a następnie mówimy Reactowi, że będziemy chcieli użyć efektu. Zatem do hooka `useEffect` przekazujemy funkcję, która *jest* naszym efektem. Wewnątrz tego efektu ustawiamy tytuł dokumentu, korzystając z interfejsu API przeglądarki (`document.title`). Możemy odczytać ostatnią wartość zmiennej `count` z wewnątrz efektu, ponieważ znajduje się ona w zasięgu naszej funkcji. Kiedy React będzie renderować nasz komponent, zapamięta użyty przez nas efekt, a następnie wywoła go po zaktualizowaniu drzewa DOM. Dzieje się to przy każdym renderowaniu, włączając pierwsze.
Expand Down
Loading