Same reusable component for different data fields?

Hello,

I have two separate tables that both have an “owner” field. In my app, the owner is the person responsible for working on that thing. I’m building a picker that users can use to add or change the owner.

To avoid creating repetitive logic, my thought is to have a reusable component that encapsulates all of the functionality. I know how to do that for each field separately, but is there a way to have a reusable component that sometimes binds to the owner field in Table A and sometimes binds to the owner field in Table B? I’m hoping to avoid creating two nearly identical components.

Thanks!

@justing I usually do it with some repetition in the backend. So I pass 2 states to the object the data type name as text “user” and the item data type.

Then once you have passed the state you use the coimponent with the type of the object you have already passed on top.

Only problem is that I need to duplicate the workflow for each diffrent type of objects.

Not sure if its clear, let me know.

1 Like