forked from alibaba/hooks
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'support/migrate-to-father-doc' into v1.6.0
- Loading branch information
Showing
8 changed files
with
71 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ | |
/coverage | ||
.doc | ||
.DS_Store | ||
src/.umi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export default { | ||
extraBabelPlugins: [[ | ||
'babel-plugin-import', | ||
{ | ||
libraryName: 'antd', | ||
libraryDirectory: 'es', | ||
style: true, | ||
}, | ||
]], | ||
doc: { | ||
locales: [['en-US', 'English'], ['zh-CN', '中文']] | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
title: useBoolean | ||
group: | ||
title: State Hooks | ||
path: /state | ||
--- | ||
|
||
# useBoolean | ||
|
||
优雅的管理 boolean 值的 Hook。 | ||
|
||
## 代码演示 | ||
|
||
<code src="./demo/demo1.tsx" /> | ||
|
||
## API | ||
|
||
```javascript | ||
const { | ||
state, | ||
toggle, | ||
setTrue, | ||
setFalse | ||
} = useBoolean( | ||
defaultValue?: boolean, | ||
); | ||
``` | ||
|
||
### Result | ||
|
||
| 参数 | 说明 | 类型 | | ||
|----------|--------------------------------------|----------------------| | ||
| state | 状态值 | boolean | | ||
| toggle | 触发状态更改的函数,可以接受一个可选参数修改状态值 | (value?: any) => void | | ||
| setTrue | 设置状态值为 true | () => void | | ||
| setFalse | 设置状态值为 false | () => void | | ||
|
||
### Params | ||
|
||
| 参数 | 说明 | 类型 | 默认值 | | ||
|---------|----------------------------------------------|------------------------|--------| | ||
| defaultValue | 可选项,传入默认的状态值 | boolean \| undefined | false | | ||
|