Skip to content

Commit f0cc6df

Browse files
authored
Merge branch 'master' into forms.md_to_hindi
2 parents e08a4dc + 9aa4417 commit f0cc6df

19 files changed

+60
-40
lines changed

content/community/conferences.md

+25-15
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,6 @@ Do you know of a local React.js conference? Add it here! (Please keep the list c
1212

1313
## Upcoming Conferences {#upcoming-conferences}
1414

15-
### React Finland 2019 {#react-finland-2019}
16-
April 24-26 in Helsinki, Finland
17-
18-
[Website](https://react-finland.fi/) - [Twitter](https://twitter.com/ReactFinland)
19-
20-
### ReactJS Girls Conference {#reactjs-girls-conference}
21-
May 3, 2019 in London, UK
22-
23-
[Website](https://reactjsgirls.com/) - [Twitter](https://twitter.com/reactjsgirls)
24-
25-
### <React.NotAConf /> 2019 {#reactnotaconf--2019}
26-
May 11 in Sofia, Bulgaria
27-
28-
[Website](http://react-not-a-conf.com/) - [Twitter](https://twitter.com/reactnotaconf) - [Facebook](https://www.facebook.com/events/780891358936156)
29-
3015
### ReactEurope 2019 {#reacteurope-2019}
3116
May 23-24, 2019 in Paris, France
3217

@@ -37,6 +22,11 @@ May 25, 2019 in Yerevan, Armenia
3722

3823
[Website](https://reactconf.am/) - [Twitter](https://twitter.com/ReactConfAM) - [Facebook](https://www.facebook.com/reactconf.am/) - [YouTube](https://www.youtube.com/c/JavaScriptConferenceArmenia) - [CFP](http://bit.ly/speakReact)
3924

25+
### ReactNext 2019 {#react-next-2019}
26+
June 11, 2019. Tel Aviv, Israel
27+
28+
[Website](https://react-next.com) - [Twitter](https://twitter.com/ReactNext) - [Videos](https://www.youtube.com/channel/UC3BT8hh3yTTYxbLQy_wbk2w)
29+
4030
### React Norway 2019 {#react-norway-2019}
4131
June 12, 2019. Larvik, Norway
4232

@@ -72,6 +62,11 @@ September 13th, 2019. New York, USA
7262

7363
[Website](https://reactnewyork.com/) - [Twitter](https://twitter.com/reactnewyork)
7464

65+
### React Live 2019 {#react-live-2019}
66+
September 13th, 2019. Amsterdam, The Netherlands
67+
68+
[Website](https://www.reactlive.nl/) - [Twitter](https://twitter.com/reactlivenl)
69+
7570
### React Boston 2019 {#react-boston-2019}
7671
September 21-22, 2019 in Boston, Massachusetts USA
7772

@@ -385,3 +380,18 @@ April 4-5, 2019 in Kraków, Poland
385380
April 12, 2019 in Amsterdam, The Netherlands
386381

387382
[Website](https://react.amsterdam) - [Twitter](https://twitter.com/reactamsterdam) - [Facebook](https://www.facebook.com/reactamsterdam) - [Videos](https://youtube.com/c/ReactConferences)
383+
384+
### React Finland 2019 {#react-finland-2019}
385+
April 24-26 in Helsinki, Finland
386+
387+
[Website](https://react-finland.fi/) - [Twitter](https://twitter.com/ReactFinland)
388+
389+
### ReactJS Girls Conference {#reactjs-girls-conference}
390+
May 3, 2019 in London, UK
391+
392+
[Website](https://reactjsgirls.com/) - [Twitter](https://twitter.com/reactjsgirls)
393+
394+
### <React.NotAConf /> 2019 {#reactnotaconf--2019}
395+
May 11 in Sofia, Bulgaria
396+
397+
[Website](http://react-not-a-conf.com/) - [Twitter](https://twitter.com/reactnotaconf) - [Facebook](https://www.facebook.com/events/780891358936156)

content/community/meetups.md

+1
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ Do you have a local React.js meetup? Add it here! (Please keep the list alphabet
138138
* [Portland, OR - ReactJS](https://www.meetup.com/Portland-ReactJS/)
139139
* [Provo, UT - ReactJS](https://www.meetup.com/ReactJS-Utah/)
140140
* [Sacramento, CA - ReactJS](https://www.meetup.com/Sacramento-ReactJS-Meetup/)
141+
* [San Francisco - Real World React](https://www.meetup.com/Real-World-React)
141142
* [San Francisco - ReactJS](https://www.meetup.com/ReactJS-San-Francisco/)
142143
* [San Francisco, CA - React Native](https://www.meetup.com/React-Native-San-Francisco/)
143144
* [San Ramon, CA - TriValley Coders](https://www.meetup.com/trivalleycoders/)

content/docs/code-splitting.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ const App = () => (
247247

248248
## Named Exports {#named-exports}
249249

250-
`React.lazy` currently only supports default exports. If the module you want to import uses named exports, you can create an intermediate module that reexports it as the default. This ensures that treeshaking keeps working and that you don't pull in unused components.
250+
`React.lazy` currently only supports default exports. If the module you want to import uses named exports, you can create an intermediate module that reexports it as the default. This ensures that tree shaking keeps working and that you don't pull in unused components.
251251

252252
```js
253253
// ManyComponents.js

content/docs/faq-functions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class Foo extends Component {
8383

8484
>**Note:**
8585
>
86-
>Using an arrow function in render creates a new function each time the component renders, which may have performance implications (see below).
86+
>Using an arrow function in render creates a new function each time the component renders, which may break optimizations based on strict identity comparison.
8787
8888
### Is it OK to use arrow functions in render methods? {#is-it-ok-to-use-arrow-functions-in-render-methods}
8989

content/docs/hooks-effect.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ function FriendStatusWithCounter(props) {
333333
}
334334
```
335335
336-
**Hooks lets us split the code based on what it is doing** rather than a lifecycle method name. React will apply *every* effect used by the component, in the order they were specified.
336+
**Hooks let us split the code based on what it is doing** rather than a lifecycle method name. React will apply *every* effect used by the component, in the order they were specified.
337337
338338
### Explanation: Why Effects Run on Each Update {#explanation-why-effects-run-on-each-update}
339339
@@ -473,7 +473,7 @@ In the future, the second argument might get added automatically by a build-time
473473
>
474474
>If you use this optimization, make sure the array includes **all values from the component scope (such as props and state) that change over time and that are used by the effect**. Otherwise, your code will reference stale values from previous renders. Learn more about [how to deal with functions](/docs/hooks-faq.html#is-it-safe-to-omit-functions-from-the-list-of-dependencies) and [what to do when the array changes too often](/docs/hooks-faq.html#what-can-i-do-if-my-effect-dependencies-change-too-often).
475475
>
476-
>If you want to run an effect and clean it up only once (on mount and unmount), you can pass an empty array (`[]`) as a second argument. This tells React that your effect doesn't depend on *any* values from props or state, so it never needs to re-run. This isn't handled as a special case -- it follows directly from how the inputs array always works.
476+
>If you want to run an effect and clean it up only once (on mount and unmount), you can pass an empty array (`[]`) as a second argument. This tells React that your effect doesn't depend on *any* values from props or state, so it never needs to re-run. This isn't handled as a special case -- it follows directly from how the dependencies array always works.
477477
>
478478
>If you pass an empty array (`[]`), the props and state inside the effect will always have their initial values. While passing `[]` as the second argument is closer to the familiar `componentDidMount` and `componentWillUnmount` mental model, there are usually [better](/docs/hooks-faq.html#is-it-safe-to-omit-functions-from-the-list-of-dependencies) [solutions](/docs/hooks-faq.html#what-can-i-do-if-my-effect-dependencies-change-too-often) to avoid re-running effects too often. Also, don't forget that React defers running `useEffect` until after the browser has painted, so doing extra work is less of a problem.
479479
>

content/docs/hooks-faq.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ The [`useMemo`](/docs/hooks-reference.html#usememo) Hook lets you cache calculat
740740
const memoizedValue = useMemo(() => computeExpensiveValue(a, b), [a, b]);
741741
```
742742

743-
This code calls `computeExpensiveValue(a, b)`. But if the inputs `[a, b]` haven't changed since the last value, `useMemo` skips calling it a second time and simply reuses the last value it returned.
743+
This code calls `computeExpensiveValue(a, b)`. But if the dependencies `[a, b]` haven't changed since the last value, `useMemo` skips calling it a second time and simply reuses the last value it returned.
744744

745745
Remember that the function passed to `useMemo` runs during rendering. Don't do anything there that you wouldn't normally do while rendering. For example, side effects belong in `useEffect`, not `useMemo`.
746746

@@ -767,7 +767,7 @@ Note that this approach won't work in a loop because Hook calls [can't](/docs/ho
767767

768768
### How to create expensive objects lazily? {#how-to-create-expensive-objects-lazily}
769769

770-
`useMemo` lets you [memoize an expensive calculation](#how-to-memoize-calculations) if the inputs are the same. However, it only serves as a hint, and doesn't *guarantee* the computation won't re-run. But sometimes you need to be sure an object is only created once.
770+
`useMemo` lets you [memoize an expensive calculation](#how-to-memoize-calculations) if the dependencies are the same. However, it only serves as a hint, and doesn't *guarantee* the computation won't re-run. But sometimes you need to be sure an object is only created once.
771771

772772
**The first common use case is when creating the initial state is expensive:**
773773

@@ -844,9 +844,9 @@ Traditionally, performance concerns around inline functions in React have been r
844844
}, [a, b]);
845845
```
846846
847-
* The [`useMemo` Hook](/docs/hooks-faq.html#how-to-memoize-calculations) makes it easier to control when individual children update, reducing the need for pure components.
847+
* The [`useMemo`](/docs/hooks-faq.html#how-to-memoize-calculations) Hook makes it easier to control when individual children update, reducing the need for pure components.
848848
849-
* Finally, the `useReducer` Hook reduces the need to pass callbacks deeply, as explained below.
849+
* Finally, the [`useReducer`](/docs/hooks-reference.html#usereducer) Hook reduces the need to pass callbacks deeply, as explained below.
850850
851851
### How to avoid passing callbacks down? {#how-to-avoid-passing-callbacks-down}
852852

content/docs/hooks-intro.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ We'll discuss this more in [Using the Effect Hook](/docs/hooks-effect.html#tip-u
8181

8282
In addition to making code reuse and code organization more difficult, we've found that classes can be a large barrier to learning React. You have to understand how `this` works in JavaScript, which is very different from how it works in most languages. You have to remember to bind the event handlers. Without unstable [syntax proposals](https://babeljs.io/docs/en/babel-plugin-transform-class-properties/), the code is very verbose. People can understand props, state, and top-down data flow perfectly well but still struggle with classes. The distinction between function and class components in React and when to use each one leads to disagreements even between experienced React developers.
8383

84-
Additionally, React has been out for about five years, and we want to make sure it stays relevant in the next five years. As [Svelte](https://svelte.technology/), [Angular](https://angular.io/), [Glimmer](https://glimmerjs.com/), and others show, [ahead-of-time compilation](https://en.wikipedia.org/wiki/Ahead-of-time_compilation) of components has a lot of future potential. Especially if it's not limited to templates. Recently, we've been experimenting with [component folding](https://github.com/facebook/react/issues/7323) using [Prepack](https://prepack.io/), and we've seen promising early results. However, we found that class components can encourage unintentional patterns that make these optimizations fall back to a slower path. Classes present issues for today's tools, too. For example, classes don't minify very well, and they make hot reloading flaky and unreliable. We want to present an API that makes it more likely for code to stay on the optimizable path.
84+
Additionally, React has been out for about five years, and we want to make sure it stays relevant in the next five years. As [Svelte](https://svelte.dev/), [Angular](https://angular.io/), [Glimmer](https://glimmerjs.com/), and others show, [ahead-of-time compilation](https://en.wikipedia.org/wiki/Ahead-of-time_compilation) of components has a lot of future potential. Especially if it's not limited to templates. Recently, we've been experimenting with [component folding](https://github.com/facebook/react/issues/7323) using [Prepack](https://prepack.io/), and we've seen promising early results. However, we found that class components can encourage unintentional patterns that make these optimizations fall back to a slower path. Classes present issues for today's tools, too. For example, classes don't minify very well, and they make hot reloading flaky and unreliable. We want to present an API that makes it more likely for code to stay on the optimizable path.
8585

8686
To solve these problems, **Hooks let you use more of React's features without classes.** Conceptually, React components have always been closer to functions. Hooks embrace functions, but without sacrificing the practical spirit of React. Hooks provide access to imperative escape hatches and don't require you to learn complex functional or reactive programming techniques.
8787

content/docs/hooks-reference.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ function reducer(state, action) {
226226
}
227227
}
228228

229-
function Counter({initialState}) {
229+
function Counter() {
230230
const [state, dispatch] = useReducer(reducer, initialState);
231231
return (
232232
<>

content/docs/optimizing-performance.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ new webpack.DefinePlugin({
153153
new webpack.optimize.UglifyJsPlugin()
154154
```
155155

156-
You can learn more about this in [webpack documentation](https://webpack.js.org/guides/production-build/).
156+
You can learn more about this in [webpack documentation](https://webpack.js.org/guides/production/).
157157

158158
Remember that you only need to do this for production builds. You shouldn't apply `UglifyJsPlugin` or `DefinePlugin` with `'production'` value in development because they will hide useful React warnings, and make the builds much slower.
159159

content/docs/reference-javascript-environment-requirements.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ React 16 depends on the collection types [Map](https://developer.mozilla.org/en-
1111
A polyfilled environment for React 16 using core-js to support older browsers might look like:
1212

1313
```js
14-
import 'core-js/es6/map';
15-
import 'core-js/es6/set';
14+
import 'core-js/es/map';
15+
import 'core-js/es/set';
1616

1717
import React from 'react';
1818
import ReactDOM from 'react-dom';

content/tutorial/tutorial.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ Note how in `handleClick`, we call `.slice()` to create a copy of the `squares`
523523

524524
### Why Immutability Is Important {#why-immutability-is-important}
525525

526-
In the previous code example, we suggested that you use the `.slice()` operator to create a copy of the `squares` array to modify instead of modifying the existing array. We'll now discuss immutability and why immutability is important to learn.
526+
In the previous code example, we suggested that you use the `.slice()` method to create a copy of the `squares` array to modify instead of modifying the existing array. We'll now discuss immutability and why immutability is important to learn.
527527

528528
There are generally two approaches to changing data. The first approach is to *mutate* the data by directly changing the data's values. The second approach is to replace the data with a new copy which has the desired changes.
529529

src/components/MarkdownPage/MarkdownPage.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import TitleAndMetaTags from 'components/TitleAndMetaTags';
1515
import findSectionForPath from 'utils/findSectionForPath';
1616
import toCommaSeparatedList from 'utils/toCommaSeparatedList';
1717
import {sharedStyles} from 'theme';
18-
import createOgUrl from 'utils/createOgUrl';
18+
import createCanonicalUrl from 'utils/createCanonicalUrl';
1919

2020
import type {Node} from 'types';
2121

@@ -74,7 +74,7 @@ const MarkdownPage = ({
7474
}}>
7575
<TitleAndMetaTags
7676
ogDescription={ogDescription}
77-
ogUrl={createOgUrl(markdownRemark.fields.slug)}
77+
canonicalUrl={createCanonicalUrl(markdownRemark.fields.slug)}
7878
title={`${titlePrefix}${titlePostfix}`}
7979
/>
8080
<div css={{flex: '1 0 auto'}}>

src/components/TitleAndMetaTags/TitleAndMetaTags.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,22 @@ const defaultDescription = 'A JavaScript library for building user interfaces';
1313
type Props = {
1414
title: string,
1515
ogDescription: string,
16-
ogUrl: string,
16+
canonicalUrl: string,
1717
};
1818

19-
const TitleAndMetaTags = ({title, ogDescription, ogUrl}: Props) => {
19+
const TitleAndMetaTags = ({title, ogDescription, canonicalUrl}: Props) => {
2020
return (
2121
<Helmet title={title}>
2222
<meta property="og:title" content={title} />
2323
<meta property="og:type" content="website" />
24-
{ogUrl && <meta property="og:url" content={ogUrl} />}
24+
{canonicalUrl && <meta property="og:url" content={canonicalUrl} />}
2525
<meta property="og:image" content="/logo-og.png" />
2626
<meta
2727
property="og:description"
2828
content={ogDescription || defaultDescription}
2929
/>
3030
<meta property="fb:app_id" content="623268441017527" />
31+
{canonicalUrl && <link rel="canonical" href={canonicalUrl} />}
3132
</Helmet>
3233
);
3334
};

src/pages/acknowledgements.html.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const Acknowlegements = ({data, location}) => (
2121
<div css={sharedStyles.articleLayout.content}>
2222
<Header>Acknowledgements</Header>
2323
<TitleAndMetaTags
24-
ogUrl={`${urlRoot}/acknowledgements.html`}
24+
canonicalUrl={`${urlRoot}/acknowledgements.html`}
2525
title="React - Acknowledgements"
2626
/>
2727

src/pages/blog/all.html.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const AllBlogPosts = ({data, location}: Props) => (
3030
<div css={sharedStyles.articleLayout.content}>
3131
<Header>All Posts</Header>
3232
<TitleAndMetaTags
33-
ogUrl={`${urlRoot}/blog/all.html`}
33+
canonicalUrl={`${urlRoot}/blog/all.html`}
3434
title="React - All Posts"
3535
/>
3636
<ul

src/pages/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import TitleAndMetaTags from 'components/TitleAndMetaTags';
1515
import Layout from 'components/Layout';
1616
import {colors, media, sharedStyles} from 'theme';
1717
import loadScript from 'utils/loadScript';
18-
import createOgUrl from 'utils/createOgUrl';
18+
import createCanonicalUrl from 'utils/createCanonicalUrl';
1919
import {babelURL} from 'site-constants';
2020
import logoWhiteSvg from 'icons/logo-white.svg';
2121

@@ -51,7 +51,7 @@ class Home extends Component {
5151
<Layout location={location}>
5252
<TitleAndMetaTags
5353
title="React &ndash; युज़र इंटरफ़ेसिज़ के निर्माण के लिए एक जावास्क्रिप्ट लाइब्रेरी"
54-
ogUrl={createOgUrl('index.html')}
54+
canonicalUrl={createCanonicalUrl('/')}
5555
/>
5656
<div css={{width: '100%'}}>
5757
<header

src/pages/languages.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Container from 'components/Container';
1010
import Header from 'components/Header';
1111
import TitleAndMetaTags from 'components/TitleAndMetaTags';
1212
import React from 'react';
13+
import {urlRoot} from 'site-constants';
1314
import {media, sharedStyles} from 'theme';
1415

1516
// $FlowFixMe This is a valid path
@@ -47,7 +48,10 @@ const Languages = ({location}: Props) => (
4748
<div css={sharedStyles.articleLayout.container}>
4849
<div css={sharedStyles.articleLayout.content}>
4950
<Header>Languages</Header>
50-
<TitleAndMetaTags title="React - Languages" />
51+
<TitleAndMetaTags
52+
canonicalUrl={`${urlRoot}/languages/`}
53+
title="React - Languages"
54+
/>
5155

5256
<div css={sharedStyles.markdown}>
5357
<p>

src/pages/versions.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Container from 'components/Container';
1010
import Header from 'components/Header';
1111
import TitleAndMetaTags from 'components/TitleAndMetaTags';
1212
import React from 'react';
13+
import {urlRoot} from 'site-constants';
1314
import {sharedStyles} from 'theme';
1415

1516
// $FlowFixMe This is a valid path
@@ -25,7 +26,10 @@ const Versions = ({location}: Props) => (
2526
<div css={sharedStyles.articleLayout.container}>
2627
<div css={sharedStyles.articleLayout.content}>
2728
<Header>React Versions</Header>
28-
<TitleAndMetaTags title="React - Versions" />
29+
<TitleAndMetaTags
30+
canonicalUrl={`${urlRoot}/versions/`}
31+
title="React - Versions"
32+
/>
2933
<div css={sharedStyles.markdown}>
3034
<p>
3135
A complete release history for React is available{' '}
File renamed without changes.

0 commit comments

Comments
 (0)