I have a question on component best practices.
I’m creating a form that I want to use on multiple pages within the same project, but also copy over to other projects with as little effort as possible. I’ve converted it to a component and added it to the library for use in other projects.
My component, however, needs to draw on a supabase table for some of the details presented in the form. Collections are only available to be added to the page and it doesn’t appear like I can create a collection within the component (probably because the other project may not have the same supabase database connection)
Is the best practice to create an “Any” property within the component and bind a collection to that Any property outside of the component? Then map all of the any fields to the fields within my component? My concern is if I map directly to the collection outside of the component, then all of my mappings will be gone when I put it in another project.
Or is there a better method to accomplish this?
Again, I’m looking to use this component in another completely separate project, so want to make the embedding of it to be as simple as possible.s
Also, what is the use case for the “Collection Id” property within the component? It appears to just return the Id and none of the values of the collection its bound to.
Thanks!