Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
tesseralis authored May 7, 2019
2 parents 248d36f + 7147f9b commit 8585063
Show file tree
Hide file tree
Showing 10 changed files with 170 additions and 38 deletions.
11 changes: 8 additions & 3 deletions content/community/conferences.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ April 24-26 in Helsinki, Finland

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

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

[Website](https://reactjsgirls.com/) - [Twitter](https://twitter.com/reactjsgirls)
Expand Down Expand Up @@ -47,12 +47,12 @@ June 21, 2019 Chicago, Illinois USA

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

### Chain React 2019
### Chain React 2019 {#chain-react-2019}
July 11-12, 2019. Portland, OR, USA.

[Website](https://infinite.red/ChainReactConf)

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

[Website](https://www.reactrally.com/) - [Twitter](https://twitter.com/ReactRally) - [Instagram](https://www.instagram.com/reactrally/)
Expand All @@ -72,6 +72,11 @@ September 13th, 2019. New York, USA

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

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

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

### React India 2019 {#react-india-2019}
September 26-28, 2019 in Goa, India

Expand Down
2 changes: 1 addition & 1 deletion content/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ React 문서는 Javascript 프로그래밍에 익숙한 사람을 대상으로

### 고급 개념 {#advanced-concepts}

[주요 개념](#main-concepts)에 익숙해지고 React를 더 많이 다루게 되면 보다 고급 주제에 관심을 가지게 될 것입니다. 이 섹션에서는 [context](/docs/context.html)[refs](/docs/refs-and-dom.html)와 같이 강력하지만 일반적으로 사용되지는 않는 React 기능을 소개합니다.
[주요 개념](/docs/hello-world.html)에 익숙해지고 React를 더 많이 다루게 되면 보다 고급 주제에 관심을 가지게 될 것입니다. 이 섹션에서는 [context](/docs/context.html)[refs](/docs/refs-and-dom.html)와 같이 강력하지만 일반적으로 사용되지는 않는 React 기능을 소개합니다.

### API 참조 {#api-reference}

Expand Down
4 changes: 2 additions & 2 deletions content/docs/hooks-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ There are a few more heuristics, and they might change over time as we fine-tune

* `componentDidCatch` and `getDerivedStateFromError`: There are no Hook equivalents for these methods yet, but they will be added soon.

### How can I do data fetching with Hooks?
### How can I do data fetching with Hooks? {#how-can-i-do-data-fetching-with-hooks}

Here is a [small demo](https://codesandbox.io/s/jvvkoo8pq3) to get you started. To learn more, check out [this article](https://www.robinwieruch.de/react-hooks-fetch-data/) about data fetching with Hooks.

Expand Down Expand Up @@ -654,7 +654,7 @@ function ProductDetails({ fetchProduct })

Note that in the above example we **need** to keep the function in the dependencies list. This ensures that a change in the `productId` prop of `ProductPage` automatically triggers a refetch in the `ProductDetails` component.

### What can I do if my effect dependencies change too often?
### What can I do if my effect dependencies change too often? {#what-can-i-do-if-my-effect-dependencies-change-too-often}

Sometimes, your effect may be using reading state that changes too often. You might be tempted to omit that state from a list of dependencies, but that usually leads to bugs:

Expand Down
2 changes: 1 addition & 1 deletion content/docs/hooks-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ prev: hooks-overview.html

*Hook*은 React 16.8버전에 새로 추가되었습니다. Hook은 클래스 컴포넌트를 작성하지 않아도 state와 같은 특징들을 사용할 수 있습니다.

[이전 페이지](/docs/hooks-intro.html)에서 아래의 예시를 통해 Hook을 소개했습니다.
[Hook 소개](/docs/hooks-intro.html)에서 아래 예시를 통해 Hook과 친해졌습니다.

```js{4-5}
import React, { useState } from 'react';
Expand Down
10 changes: 9 additions & 1 deletion content/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
translated_name: বাংলা
code: bn
status: 0
- name: Catalan
translated_name: Català
code: ca
status: 0
- name: German
translated_name: Deutsch
code: de
Expand Down Expand Up @@ -99,6 +103,10 @@
translated_name: മലയാളം
code: ml
status: 0
- name: Mongolian
translated_name: Монгол хэл
code: mn
status: 0
- name: Nepali
translated_name: नेपाली
code: ne
Expand All @@ -110,7 +118,7 @@
- name: Polish
translated_name: Polski
code: pl
status: 1
status: 2
- name: Portuguese (Brazil)
translated_name: Português do Brasil
code: pt-br
Expand Down
44 changes: 24 additions & 20 deletions content/warnings/refs-must-have-owner.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,49 @@ layout: single
permalink: warnings/refs-must-have-owner.html
---

You are probably here because you got one of the following error messages:
다음 오류 메시지 중 하나가 나왔기 때문에 여기에 있을 것입니다.

*React 16.0.0+*
> Warning:
> 경고
>
> Element ref was specified as a string (myRefName) but no owner was set. You may have multiple copies of React loaded. (details: https://fb.me/react-refs-must-have-owner).
>
> 엘리먼트의 ref가 문자열 (myRefName)로 지정되었지만, 소유자가 설정되지 않았습니다. 여러 개의 React가 로딩됐을 수 있습니다. (자세히 알아보기. https://fb.me/react-refs-must-have-owner)
*earlier versions of React*
> Warning:
*이전 버전의 React*
> 경고
>
> addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's `render` method, or you have multiple copies of React loaded.
>
> addComponentAsRefTo(...): ReactOwner만 refs를 가질 수 있습니다. 컴포넌트의 `render` 메서드 안에 생성되지 않은 컴포넌트에 ref를 추가하거나, React가 여러 개 로딩됐을 수 있습니다.
This usually means one of three things:
이것은 일반적으로 다음 세 가지 중 하나를 의미합니다.

- You are trying to add a `ref` to a function component.
- You are trying to add a `ref` to an element that is being created outside of a component's render() function.
- You have multiple (conflicting) copies of React loaded (eg. due to a misconfigured npm dependency)
- 함수 컴포넌트에 `ref`를 추가하려고 했을 경우입니다.
- 컴포넌트의 render() 함수 외부에서 생성되는 엘리먼트에 `ref`를 추가하려고 했을 경우입니다.
- 여러 개의 (충돌하는) React가 있습니다. (예시. 잘못 설정된 npm 의존성 때문에)

## Refs on Function Components {#refs-on-function-components}
## 함수 컴포넌트에서의 refs {#refs-on-function-components}

If `<Foo>` is a function component, you can't add a ref to it:
`<Foo>`가 함수 컴포넌트인 경우 ref를 추가할 수 없습니다.

```js
// Doesn't work if Foo is a function!
// Foo가 함수 컴포넌트인 경우 작동하지 않습니다!
<Foo ref={foo} />
```

If you need to add a ref to a component, convert it to a class first, or consider not using refs as they are [rarely necessary](/docs/refs-and-the-dom.html#when-to-use-refs).
컴포넌트에 ref를 추가해야 하는 경우 먼저 클래스로 컴포넌트로 변경하거나 refs가 필요한 경우가 [거의 없으므로](/docs/refs-and-the-dom.html#when-to-use-refs) ref를 사용하지 않는 것이 좋습니다.

## Strings Refs Outside the Render Method {#strings-refs-outside-the-render-method}
## render 메서드 외부에서의 문자열 refs {#strings-refs-outside-the-render-method}

This usually means that you're trying to add a ref to a component that doesn't have an owner (that is, was not created inside of another component's `render` method). For example, this won't work:
이것은 일반적으로 소유자가 없는 컴포넌트에 ref를 추가하려는 것입니다. (즉, 다른 컴포넌트의 `render` 메서드 내부에서 생성되지 않았다는 것입니다) 예를 들어, 다음은 작동하지 않습니다.

```js
// Doesn't work!
// 작동하지 않습니다!
ReactDOM.render(<App ref="app" />, el);
```

Try rendering this component inside of a new top-level component which will hold the ref. Alternatively, you may use a callback ref:
이 컴포넌트를 ref를 소유할 새로운 최상위 컴포넌트 안에 렌더링해 보세요. 또는 콜백 ref를 사용할 수도 있습니다.

```js
let app;
Expand All @@ -54,10 +58,10 @@ ReactDOM.render(
);
```

Consider if you [really need a ref](/docs/refs-and-the-dom.html#when-to-use-refs) before using this approach.
이 방법을 사용하기 전에 [정말 ref가 필요한지](/docs/refs-and-the-dom.html#when-to-use-refs) 생각해보세요.

## Multiple copies of React {#multiple-copies-of-react}
## 여러 개의 React {#multiple-copies-of-react}

Bower does a good job of deduplicating dependencies, but npm does not. If you aren't doing anything (fancy) with refs, there is a good chance that the problem is not with your refs, but rather an issue with having multiple copies of React loaded into your project. Sometimes, when you pull in a third-party module via npm, you will get a duplicate copy of the dependency library, and this can create problems.
Bower는 의존성 중복 제거 작업을 잘하지만 npm은 그렇지 않습니다. refs로 특별한 일을 하는 게 아니라면, refs 문제가 아니라는 좋은 징조입니다. 그보다는 오히려 여러 개의 React가 프로젝트에 로딩되는 문제일 가능성이 있습니다. 때에 따라 npm을 통해 서드파티 모듈을 가져오면 의존성 라이브러리에 중복된 사본이 생성되어 문제가 발생할 수 있습니다.

If you are using npm... `npm ls` or `npm ls react` might help illuminate.
npm을 사용한다면... 'npm ls' 또는 'npm ls react'가 이 도움이 될 수 있습니다.
1 change: 1 addition & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ module.exports = {
maxWidth: 840,
},
},
'gatsby-remark-external-links',
'gatsby-remark-header-custom-ids',
{
resolve: 'gatsby-remark-code-repls',
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"gatsby-remark-code-repls": "^2.0.0",
"gatsby-remark-copy-linked-files": "^2.0.0",
"gatsby-remark-embed-snippet": "^3.0.0",
"gatsby-remark-external-links": "^0.0.4",
"gatsby-remark-images": "^2.0.0",
"gatsby-remark-prismjs": "^3.0.2",
"gatsby-remark-responsive-iframe": "^2.0.0",
Expand Down
52 changes: 43 additions & 9 deletions src/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,15 +285,24 @@ const sharedStyles = {
},

'& h2': {
borderTop: `1px solid ${colors.divider}`,
marginTop: 44,
paddingTop: 40,
'::before': {
content: ' ',
display: 'block',
borderBottom: `1px solid ${colors.divider}`,
paddingTop: 44,
marginBottom: 40,
},

lineHeight: 1.2,

':first-child': {
borderTop: 0,
marginTop: 0,
paddingTop: 0,
'::before': {
content: ' ',
display: 'block',
borderBottom: 0,
paddingTop: 40,
marginTop: -80,
},
},

[media.lessThan('large')]: {
Expand All @@ -310,7 +319,12 @@ const sharedStyles = {
},

'& h3': {
paddingTop: 45,
'::before': {
content: ' ',
display: 'block',
paddingTop: 90,
marginTop: -45,
},

[media.lessThan('small')]: {
overflowWrap: 'break-word',
Expand All @@ -324,14 +338,25 @@ const sharedStyles = {
},

'& h2 + h3, & h2 + h3:first-of-type': {
paddingTop: 30,
'::before': {
content: ' ',
display: 'block',
paddingTop: 60,
marginTop: -30,
},
},

'& h4': {
'::before': {
content: ' ',
display: 'block',
paddingTop: 100,
marginTop: -50,
},

fontSize: 20,
color: colors.subtle,
lineHeight: 1.3,
marginTop: 50,
fontWeight: 400,
},

Expand Down Expand Up @@ -414,6 +439,15 @@ const sharedStyles = {
'& .gatsby-highlight + blockquote': {
marginTop: 40,
},

'& .gatsby-highlight + h4': {
'::before': {
content: ' ',
display: 'block',
paddingTop: 85,
marginTop: -60,
},
},
},
};

Expand Down
Loading

0 comments on commit 8585063

Please sign in to comment.