I\'m building web apps using react and typescript. I have quite similar components and only different api. How can I write generic components that can be reused? I just star