-
Notifications
You must be signed in to change notification settings - Fork 90
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
feat: add useFileInput hook #624
Conversation
Preview is ready. |
@@ -0,0 +1,21 @@ | |||
import React from 'react'; |
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.
Filename is Select.stories.tsx
); | ||
|
||
return { | ||
controlProps: { |
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 memo this object?
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 do it?
}; | ||
``` | ||
*/ | ||
export function useFileInput({ref, onUpdate, onChange}: UseFileInputProps): UseFileInputOutput { |
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.
Maybe it's better to return the ref from the hook?
); | ||
|
||
return { | ||
controlProps: { |
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 do it?
style: {opacity: 0, position: 'absolute', width: 1, height: 1}, | ||
onChange: handleChange, | ||
}, | ||
openDeviceStorage, |
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 make like with controlProps:
openDeviceStorage, | |
triggerProps: { | |
onClick: openDeviceStorage, | |
}, |
No description provided.