-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: private hooks directory #1091
Conversation
Preview is ready. |
152d969
to
10b8975
Compare
@@ -0,0 +1,26 @@ | |||
# useCheckbox | |||
|
|||
The `useCheckbox` hook need to generate props for radio group element |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
radio group element -> checkbox control
|
||
## Result | ||
|
||
- checked, radio-input status `boolean` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use md table here, checked - Checked state, inputProps - Props to pass to the input element
## Result | ||
|
||
- onMouseOver, `React.MouseEventHandler` | ||
- onMouseLeave, `React.MouseEventHandler` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
md table
src/hooks/private/useRadio/README.md
Outdated
@@ -0,0 +1,25 @@ | |||
# useRadio | |||
|
|||
The `useRadio` hook need to generate props for radio group element |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
element -> control
src/hooks/private/useRadio/README.md
Outdated
## Result | ||
|
||
- checked, radio-input status `boolean` | ||
- inputProps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as for useCheckbox
@@ -0,0 +1,22 @@ | |||
# useRadioGroup | |||
|
|||
The `useRadioGroup` hook need to generate props for radio group element |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
element -> control
## Result | ||
|
||
- containerProps | ||
- optionsProps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as for useCheckbox
|
||
## Result | ||
|
||
- onFocus, `(event: React.FocusEvent) => void` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
md table
## Result | ||
|
||
- state, `any` | ||
- setWithCallback, `(nextValue: T | ((value: T) => T)) => void` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
md table
10b8975
to
82f6ddc
Compare
export * from './useBoolean'; | ||
export * from './useCheckbox'; | ||
export * from './useCloseOnTimeout'; | ||
export * from './useConditionallyControlledState'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this private hook? It's general, it can be used by any app.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was not exported outside
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok ✅
Seems like it will be good to make it public.
82f6ddc
to
25d4164
Compare
No description provided.