Skip to content

Commit

Permalink
Merge branch 'master' into forms.md_to_hindi
Browse files Browse the repository at this point in the history
  • Loading branch information
SahibArora authored May 20, 2019
2 parents e08a4dc + 9aa4417 commit f0cc6df
Show file tree
Hide file tree
Showing 19 changed files with 60 additions and 40 deletions.
40 changes: 25 additions & 15 deletions content/community/conferences.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,6 @@ Do you know of a local React.js conference? Add it here! (Please keep the list c

## Upcoming Conferences {#upcoming-conferences}

### React Finland 2019 {#react-finland-2019}
April 24-26 in Helsinki, Finland

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

### ReactJS Girls Conference {#reactjs-girls-conference}
May 3, 2019 in London, UK

[Website](https://reactjsgirls.com/) - [Twitter](https://twitter.com/reactjsgirls)

### <React.NotAConf /> 2019 {#reactnotaconf--2019}
May 11 in Sofia, Bulgaria

[Website](http://react-not-a-conf.com/) - [Twitter](https://twitter.com/reactnotaconf) - [Facebook](https://www.facebook.com/events/780891358936156)

### ReactEurope 2019 {#reacteurope-2019}
May 23-24, 2019 in Paris, France

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

[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)

### ReactNext 2019 {#react-next-2019}
June 11, 2019. Tel Aviv, Israel

[Website](https://react-next.com) - [Twitter](https://twitter.com/ReactNext) - [Videos](https://www.youtube.com/channel/UC3BT8hh3yTTYxbLQy_wbk2w)

### React Norway 2019 {#react-norway-2019}
June 12, 2019. Larvik, Norway

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

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

### React Live 2019 {#react-live-2019}
September 13th, 2019. Amsterdam, The Netherlands

[Website](https://www.reactlive.nl/) - [Twitter](https://twitter.com/reactlivenl)

### React Boston 2019 {#react-boston-2019}
September 21-22, 2019 in Boston, Massachusetts USA

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

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

### React Finland 2019 {#react-finland-2019}
April 24-26 in Helsinki, Finland

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

### ReactJS Girls Conference {#reactjs-girls-conference}
May 3, 2019 in London, UK

[Website](https://reactjsgirls.com/) - [Twitter](https://twitter.com/reactjsgirls)

### <React.NotAConf /> 2019 {#reactnotaconf--2019}
May 11 in Sofia, Bulgaria

[Website](http://react-not-a-conf.com/) - [Twitter](https://twitter.com/reactnotaconf) - [Facebook](https://www.facebook.com/events/780891358936156)
1 change: 1 addition & 0 deletions content/community/meetups.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ Do you have a local React.js meetup? Add it here! (Please keep the list alphabet
* [Portland, OR - ReactJS](https://www.meetup.com/Portland-ReactJS/)
* [Provo, UT - ReactJS](https://www.meetup.com/ReactJS-Utah/)
* [Sacramento, CA - ReactJS](https://www.meetup.com/Sacramento-ReactJS-Meetup/)
* [San Francisco - Real World React](https://www.meetup.com/Real-World-React)
* [San Francisco - ReactJS](https://www.meetup.com/ReactJS-San-Francisco/)
* [San Francisco, CA - React Native](https://www.meetup.com/React-Native-San-Francisco/)
* [San Ramon, CA - TriValley Coders](https://www.meetup.com/trivalleycoders/)
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 @@ -247,7 +247,7 @@ const App = () => (

## Named Exports {#named-exports}

`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.
`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.

```js
// ManyComponents.js
Expand Down
2 changes: 1 addition & 1 deletion content/docs/faq-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class Foo extends Component {

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

Expand Down
4 changes: 2 additions & 2 deletions content/docs/hooks-effect.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ function FriendStatusWithCounter(props) {
}
```
**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.
**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.
### Explanation: Why Effects Run on Each Update {#explanation-why-effects-run-on-each-update}
Expand Down Expand Up @@ -473,7 +473,7 @@ In the future, the second argument might get added automatically by a build-time
>
>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).
>
>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.
>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.
>
>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.
>
Expand Down
8 changes: 4 additions & 4 deletions content/docs/hooks-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ The [`useMemo`](/docs/hooks-reference.html#usememo) Hook lets you cache calculat
const memoizedValue = useMemo(() => computeExpensiveValue(a, b), [a, b]);
```

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.
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.

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`.

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

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

`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.
`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.

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

Expand Down Expand Up @@ -844,9 +844,9 @@ Traditionally, performance concerns around inline functions in React have been r
}, [a, b]);
```
* 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.
* 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.
* Finally, the `useReducer` Hook reduces the need to pass callbacks deeply, as explained below.
* Finally, the [`useReducer`](/docs/hooks-reference.html#usereducer) Hook reduces the need to pass callbacks deeply, as explained below.
### How to avoid passing callbacks down? {#how-to-avoid-passing-callbacks-down}
Expand Down
2 changes: 1 addition & 1 deletion content/docs/hooks-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ We'll discuss this more in [Using the Effect Hook](/docs/hooks-effect.html#tip-u

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.

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.
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.

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.

Expand Down
2 changes: 1 addition & 1 deletion content/docs/hooks-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ function reducer(state, action) {
}
}

function Counter({initialState}) {
function Counter() {
const [state, dispatch] = useReducer(reducer, initialState);
return (
<>
Expand Down
2 changes: 1 addition & 1 deletion content/docs/optimizing-performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ new webpack.DefinePlugin({
new webpack.optimize.UglifyJsPlugin()
```

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

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.

Expand Down
4 changes: 2 additions & 2 deletions content/docs/reference-javascript-environment-requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ React 16 depends on the collection types [Map](https://developer.mozilla.org/en-
A polyfilled environment for React 16 using core-js to support older browsers might look like:

```js
import 'core-js/es6/map';
import 'core-js/es6/set';
import 'core-js/es/map';
import 'core-js/es/set';

import React from 'react';
import ReactDOM from 'react-dom';
Expand Down
2 changes: 1 addition & 1 deletion content/tutorial/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ Note how in `handleClick`, we call `.slice()` to create a copy of the `squares`

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

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.
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.

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.

Expand Down
4 changes: 2 additions & 2 deletions src/components/MarkdownPage/MarkdownPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import TitleAndMetaTags from 'components/TitleAndMetaTags';
import findSectionForPath from 'utils/findSectionForPath';
import toCommaSeparatedList from 'utils/toCommaSeparatedList';
import {sharedStyles} from 'theme';
import createOgUrl from 'utils/createOgUrl';
import createCanonicalUrl from 'utils/createCanonicalUrl';

import type {Node} from 'types';

Expand Down Expand Up @@ -74,7 +74,7 @@ const MarkdownPage = ({
}}>
<TitleAndMetaTags
ogDescription={ogDescription}
ogUrl={createOgUrl(markdownRemark.fields.slug)}
canonicalUrl={createCanonicalUrl(markdownRemark.fields.slug)}
title={`${titlePrefix}${titlePostfix}`}
/>
<div css={{flex: '1 0 auto'}}>
Expand Down
7 changes: 4 additions & 3 deletions src/components/TitleAndMetaTags/TitleAndMetaTags.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,22 @@ const defaultDescription = 'A JavaScript library for building user interfaces';
type Props = {
title: string,
ogDescription: string,
ogUrl: string,
canonicalUrl: string,
};

const TitleAndMetaTags = ({title, ogDescription, ogUrl}: Props) => {
const TitleAndMetaTags = ({title, ogDescription, canonicalUrl}: Props) => {
return (
<Helmet title={title}>
<meta property="og:title" content={title} />
<meta property="og:type" content="website" />
{ogUrl && <meta property="og:url" content={ogUrl} />}
{canonicalUrl && <meta property="og:url" content={canonicalUrl} />}
<meta property="og:image" content="/logo-og.png" />
<meta
property="og:description"
content={ogDescription || defaultDescription}
/>
<meta property="fb:app_id" content="623268441017527" />
{canonicalUrl && <link rel="canonical" href={canonicalUrl} />}
</Helmet>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/pages/acknowledgements.html.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const Acknowlegements = ({data, location}) => (
<div css={sharedStyles.articleLayout.content}>
<Header>Acknowledgements</Header>
<TitleAndMetaTags
ogUrl={`${urlRoot}/acknowledgements.html`}
canonicalUrl={`${urlRoot}/acknowledgements.html`}
title="React - Acknowledgements"
/>

Expand Down
2 changes: 1 addition & 1 deletion src/pages/blog/all.html.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const AllBlogPosts = ({data, location}: Props) => (
<div css={sharedStyles.articleLayout.content}>
<Header>All Posts</Header>
<TitleAndMetaTags
ogUrl={`${urlRoot}/blog/all.html`}
canonicalUrl={`${urlRoot}/blog/all.html`}
title="React - All Posts"
/>
<ul
Expand Down
4 changes: 2 additions & 2 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import TitleAndMetaTags from 'components/TitleAndMetaTags';
import Layout from 'components/Layout';
import {colors, media, sharedStyles} from 'theme';
import loadScript from 'utils/loadScript';
import createOgUrl from 'utils/createOgUrl';
import createCanonicalUrl from 'utils/createCanonicalUrl';
import {babelURL} from 'site-constants';
import logoWhiteSvg from 'icons/logo-white.svg';

Expand Down Expand Up @@ -51,7 +51,7 @@ class Home extends Component {
<Layout location={location}>
<TitleAndMetaTags
title="React &ndash; युज़र इंटरफ़ेसिज़ के निर्माण के लिए एक जावास्क्रिप्ट लाइब्रेरी"
ogUrl={createOgUrl('index.html')}
canonicalUrl={createCanonicalUrl('/')}
/>
<div css={{width: '100%'}}>
<header
Expand Down
6 changes: 5 additions & 1 deletion src/pages/languages.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Container from 'components/Container';
import Header from 'components/Header';
import TitleAndMetaTags from 'components/TitleAndMetaTags';
import React from 'react';
import {urlRoot} from 'site-constants';
import {media, sharedStyles} from 'theme';

// $FlowFixMe This is a valid path
Expand Down Expand Up @@ -47,7 +48,10 @@ const Languages = ({location}: Props) => (
<div css={sharedStyles.articleLayout.container}>
<div css={sharedStyles.articleLayout.content}>
<Header>Languages</Header>
<TitleAndMetaTags title="React - Languages" />
<TitleAndMetaTags
canonicalUrl={`${urlRoot}/languages/`}
title="React - Languages"
/>

<div css={sharedStyles.markdown}>
<p>
Expand Down
6 changes: 5 additions & 1 deletion src/pages/versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Container from 'components/Container';
import Header from 'components/Header';
import TitleAndMetaTags from 'components/TitleAndMetaTags';
import React from 'react';
import {urlRoot} from 'site-constants';
import {sharedStyles} from 'theme';

// $FlowFixMe This is a valid path
Expand All @@ -25,7 +26,10 @@ const Versions = ({location}: Props) => (
<div css={sharedStyles.articleLayout.container}>
<div css={sharedStyles.articleLayout.content}>
<Header>React Versions</Header>
<TitleAndMetaTags title="React - Versions" />
<TitleAndMetaTags
canonicalUrl={`${urlRoot}/versions/`}
title="React - Versions"
/>
<div css={sharedStyles.markdown}>
<p>
A complete release history for React is available{' '}
Expand Down
File renamed without changes.

0 comments on commit f0cc6df

Please sign in to comment.