Skip to content

Commit

Permalink
delete space
Browse files Browse the repository at this point in the history
  • Loading branch information
seiyatakahashi committed May 7, 2020
1 parent 61c6ce7 commit 9a4b02f
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions content/blog/2020-02-26-react-v16.13.0.md
Expand Up @@ -35,7 +35,6 @@ Warning: Cannot update a component from inside the function body of a different
```

この `<div>``toggle` の値に関係なく常に背景色が赤になると思われるかもしれません。しかし、[このデモを見てわかるように](https://codesandbox.io/s/suspicious-sunset-g3jub)`toggle` の値を `true``false` の間で切り替えると、背景色は `red` から始まり、その後 `transparent``blue` の間で交互に切り替わります。


**Reactは、スタイルルールの競合を検出し、警告をログに記録するようになりました。**この問題を修正するには、同一の CSS プロパティの短い記法と長い記法のバージョンを `style` プロパティ内で混在させないようにしてください。

Expand All @@ -49,7 +48,6 @@ Warning: Cannot update a component from inside the function body of a different

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


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

例えば、レンダープロップパターンと一緒に string ref を使用した場合に発生します。
Expand All @@ -75,11 +73,9 @@ 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 @@ -108,7 +104,7 @@ class ClassParent extends React.Component {
>
> If you use Create React App or have the "react" preset with Babel 7+, you already have this plugin installed by default.
### `React.createFactory`は推奨しない{#deprecating-reactcreatefactory}
### `React.createFactory`の非推奨化{#deprecating-reactcreatefactory}

[`React.createFactory`](/docs/react-api.html#createfactory) は React 要素を作成するためのレガシーのヘルパです。このリリースでは、このメソッドに非推奨の警告が追加されています。これは将来のメジャーバージョンで削除される予定です。

Expand All @@ -120,7 +116,7 @@ let createFactory = type => React.createElement.bind(null, type);

全く同じことをしています。

### `ReactDOM.unstable_createPortal``ReactDOM.createPortal`に変更することを推奨しない{#deprecating-reactdomunstable_createportal-in-favor-of-reactdomcreateportal}
### `ReactDOM.unstable_createPortal` の非推奨化(`ReactDOM.createPortal` に変更を) {#deprecating-reactdomunstable_createportal-in-favor-of-reactdomcreateportal}

React 16がリリースされたとき、`createPortal`は公式にサポートされるAPIになりました。

Expand Down Expand Up @@ -161,19 +157,19 @@ React は開発者向け警告にコンポーネントスタックを追加し

React v16.13.0 はnpmで利用可能です。

YarnでReact 16をインストールするには、下記を実行します
YarnでReact 16をインストールするには、下記を実行します:

```bash
yarn add react@^16.13.0 react-dom@^16.13.0
```

npmでReact 16をインストールするには、下記を実行します
npmでReact 16をインストールするには、下記を実行します:

```bash
npm install --save react@^16.13.0 react-dom@^16.13.0
```

また、CDN経由でReactのUMDビルドも提供しています
また、CDN経由でReactのUMDビルドも提供しています:

```html
<script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
Expand Down

0 comments on commit 9a4b02f

Please sign in to comment.