Skip to content

Commit

Permalink
docs: Change README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ShenChang618 committed May 13, 2019
1 parent 2151d78 commit 820c6a7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ Children of `<KeepAlive>` will be cached, but we have to make sure that `<KeepAl

`disabled`: When we don't need components for caching, we can disable it; the disabled configuration will only takes effect when the component's status changes from unactive to active.

**Note**: `<KeepAlive>` The innermost outer layer of the packaged component must have a real DOM tag.

#### Example
```JavaScript
import React from 'react';
Expand All @@ -164,6 +166,7 @@ import {
class One extends React.Component {
render() {
return (
// a real DOM tag
<div>This is One.</div>
);
}
Expand Down
2 changes: 2 additions & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ npm install react-router@next react-router-dom@next

`disabled`:当我们不需要缓存组件时,我们可以禁用它;禁用仅在组件从未激活状态变为激活状态时生效。

**注意**`<KeepAlive>` 包裹的组件内部最外层必须有一个真实的 DOM 标签。


#### 例子
```JavaScript
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-keep-alive",
"version": "2.0.0-alpha.0",
"version": "2.0.0",
"description": "Package will allow components to maintain their status, to avoid repeated re-rendering.",
"author": "Shen Chang",
"homepage": "https://github.com/Sam618/react-keep-alive",
Expand Down

0 comments on commit 820c6a7

Please sign in to comment.