Skip to content

Commit 9d1c244

Browse files
committed
chore: update readme
1 parent 2753991 commit 9d1c244

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

README.md

+9-11
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,22 @@
22

33
A simple `React.useState` sugar based on js label
44

5+
just for fun :) 😄
6+
57
### Quick Start
6-
1⃣️ install
7-
```
8+
```sh
9+
# install
810
npm install --save-dev babel-plugin-react-label-sugar
911
```
1012

11-
2⃣️ add plugin in .babelrc
13+
Add plugin in .babelrc
1214
```json
1315
{
1416
"plugins": ["babel-plugin-react-label-sugar"]
1517
}
1618
```
1719

18-
3⃣️ (optional) custom options
20+
(optional) custom options
1921
```json5
2022
{
2123
"refLabel": "$", // default is "ref"
@@ -54,11 +56,11 @@ $: student = { name: "xyy" };
5456

5557
_**Work with immer**_
5658

57-
1⃣️ set `ignoreMemberExpr` to be `true` in `.babelrc`
59+
Set `ignoreMemberExpr` to be `true` in `.babelrc`
5860

59-
2⃣️ set `refFactory` to be `useImmer` in `.babelrc`
61+
Set `refFactory` to be `useImmer` in `.babelrc`
6062

61-
3⃣️ install and import `useImmer` in your code
63+
Install and import `useImmer` in your code
6264

6365
```jsx
6466
// before
@@ -72,7 +74,3 @@ setObj((obj) => { obj.count++ });
7274

7375
### Todo List
7476
- [x] support useImmer, transpile `obj.value = 1` to `setObject(obj => obj.value = 1)`
75-
76-
### But why?
77-
78-
just for fun :) 😄

0 commit comments

Comments
 (0)