In React.js I have a function which receives two parameters (id: string, User: UserDto), I want to use this function in two different components, on a first components, it works fine but on a second components, I need User to be not UserDto but UserDto[].
In my reusable function, how can I pass User so it can work as UserDto in one component and as UserDto[] in a second component?
function foo(id: string, User: UserDto) { .... }and in another component you want .... what?