Skip to content

Commit

Permalink
add refs docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nanxiaobei committed Jan 29, 2024
1 parent e89406c commit 789c671
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,20 @@ store((s) => ({
}));
```

**None-state variables (Refs)**

Actually it's not related to resso, it's just JavaScript. You can do it like this:

```jsx
// store.js
export const refs = {
total: 0,
};

// App.js
import store, { refs } from './store';
```

---

**\* `react<18` batch update**
Expand Down
14 changes: 14 additions & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,20 @@ store((s) => ({
}));
```

**非 state 变量 (Refs)**

事实上它与 resso 无关,只是 JavaScript。你可以这样做:

```jsx
// store.js
export const refs = {
total: 0,
};

// App.js
import store, { refs } from './store';
```

---

**\* `react<18` 批量更新**
Expand Down

0 comments on commit 789c671

Please sign in to comment.