Skip to content

Commit

Permalink
fix: FileInput and FileUploadButton prop types fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Anlerkan authored and mucahit committed Mar 11, 2022
1 parent 3511ff8 commit b693115
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
11 changes: 3 additions & 8 deletions src/button/file-upload/FileUploadButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,17 @@ import classNames from "classnames";

import FileInput, {FileInputProps} from "../../form/input/file/FileInput";

export type FileUploadButtonProps = Omit<
FileInputProps,
"children" | "onChange" | "children"
> & {
children: React.ReactNode;
customClassName?: string;
export type FileUploadButtonProps = Omit<FileInputProps, "onChange"> & {
customLabelClassName?: string;
ref?: React.RefObject<HTMLLabelElement>;
onFileSelect?: (
files: React.SyntheticEvent<HTMLInputElement>["currentTarget"]["files"]
) => void;
};

const FileUploadButton = React.forwardRef<HTMLLabelElement, Record<string, any>>(
const FileUploadButton = React.forwardRef<HTMLLabelElement, FileUploadButtonProps>(
// eslint-disable-next-line prefer-arrow-callback
function FileUploadButtonComponent(props: FileUploadButtonProps, ref) {
function FileUploadButtonComponent(props, ref) {
const {
onFileSelect,
children,
Expand Down
4 changes: 2 additions & 2 deletions src/form/input/file/FileInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ export interface FileInputProps {
ref?: React.RefObject<HTMLLabelElement>;
}

const FileInput = React.forwardRef<HTMLLabelElement, Record<string, any>>(
const FileInput = React.forwardRef<HTMLLabelElement, FileInputProps>(
// eslint-disable-next-line prefer-arrow-callback
function FileInputComponent(props: FileInputProps, ref) {
function FileInputComponent(props, ref) {
const {
onChange,
children,
Expand Down

0 comments on commit b693115

Please sign in to comment.