This PR improves the type safety of the FileButton component by removing the use of TypeScript generics and replacing it the use of discriminated unions.
As a result, TypeScript correctly infers the onChange and append variables based on the value of multiple and forwardRef correctly returns the type of the component since no generics are involved
This PR improves the type safety of the
FileButton
component by removing the use of TypeScript generics and replacing it the use of discriminated unions.As a result, TypeScript correctly infers the
onChange
andappend
variables based on the value ofmultiple
andforwardRef
correctly returns the type of the component since no generics are involved