File tree 1 file changed +19
-2
lines changed
1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,9 @@ Toggle custom hook and component wrapper for React 🔦
14
14
15
15
- [ Installing] ( #installing )
16
16
- [ Example usage] ( #example-usage )
17
+ - [ Toggle hook - ` useToggle() ` ] ( #toggle-hook---usetoggle )
18
+ - [ Toggle wrapper - ` <ToggleWrap /> ` ] ( #toggle-wrapper---togglewrap- )
19
+ - [ API] ( #api )
17
20
- [ Toggle hook] ( #toggle-hook )
18
21
- [ Toggle wrapper] ( #toggle-wrapper )
19
22
- [ Suggestions and/or questions] ( #suggestions-andor-questions )
@@ -34,7 +37,9 @@ yarn add @kodingdotninja/use-toggle
34
37
35
38
## Example usage
36
39
37
- ### Toggle hook
40
+ ### Toggle hook - ` useToggle() `
41
+
42
+ Use it as your usual hooks. ` disable ` , ` enable ` , or ` toggle ` does not accept parameters so you can use it on ` onClick ` handlers.
38
43
39
44
``` jsx
40
45
import { useToggle } from " @kodingdotninja/use-toggle" ;
@@ -53,7 +58,9 @@ function App() {
53
58
}
54
59
```
55
60
56
- ### Toggle wrapper
61
+ ### Toggle wrapper - ` <ToggleWrap /> `
62
+
63
+ Component which wraps the children with its internal hooks. Use this if you do not want to declare another component and just wrap it.
57
64
58
65
``` jsx
59
66
import { ToggleWrap } from " kodingdotninja/use-toggle" ;
@@ -75,6 +82,16 @@ function App() {
75
82
}
76
83
```
77
84
85
+ ## API
86
+
87
+ ### Toggle hook
88
+
89
+ TODO
90
+
91
+ ### Toggle wrapper
92
+
93
+ TODO
94
+
78
95
## Suggestions and/or questions
79
96
80
97
Head over to our [ dedicated Discord channel for ` use-toggle ` ] ( https://discord.gg/KsHtDasn7e ) .
You can’t perform that action at this time.
0 commit comments