Skip to content

Commit

Permalink
行数をあわせる
Browse files Browse the repository at this point in the history
  • Loading branch information
seiyatakahashi committed May 9, 2020
1 parent 2c914d3 commit 7cd1163
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion content/blog/2020-02-26-react-v16.13.0.md
Expand Up @@ -47,6 +47,7 @@ Warning: Cannot update a component from inside the function body of a different
```

(String ref と異なり、一般的なref自体は**完全にサポートされ続けます**ので混同しないようにしてください。)

将来的には、string ref からの移行を自動化するスクリプト ("codemod") を提供する予定です。しかし、まれに自動移行できないケースがあります。このリリースでは、非推奨化に先立ち、**そのようなケースにのみ**警告を追加しています。

例えば、レンダープロップパターンと一緒に string ref を使用した場合に発生します。
Expand Down Expand Up @@ -75,6 +76,7 @@ class ClassParent extends React.Component {
このようなコードはしばしばバグを示します。(ref は `ClassParent` で利用できると思われるかもしれませんが、代わりに `ClassWithRenderProp` に置かれてしまいます)。

**このようなコードはお持ちでない可能性が高いでしょう**。もしそのようなコードがあって、それが意図的なものであれば、代わりに [`React.createRef()`](/docs/refs-and-the-dom.html#creating-refs) を使うよう変更してください:

```jsx
class ClassWithRenderProp extends React.Component {
myRef = React.createRef();
Expand Down Expand Up @@ -149,7 +151,6 @@ React は開発者向け警告にコンポーネントスタックを追加し

これらの問題やその他の問題を解決してくれた貢献者に感謝します。完全な changelog は[下記](#changelog)を参照してください。


## インストール {#installation}

### React {#react}
Expand Down

0 comments on commit 7cd1163

Please sign in to comment.