#is it possible to use component in another component?

3 messages · Page 1 of 1 (latest)

marble cedar
#

I want to use the migration component in another custom component that I built

unreal kestrelBOT
#

Hi @marble cedar. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

The knowledge sources do not explicitly document or provide examples of using one Convex component (such as the migration component) from within another custom component. The current documentation and examples focus on using components within your main application code, not on composing components together or invoking one component from inside another component's sandbox.

Convex components are designed to be isolated, with their own namespace, functions, and tables. They can be called from your app's root namespace, and their functions can participate in the same transaction as your app's functions, but there is no mention of components being able to directly use or depend on other components internally. The authoring APIs for custom components are also still in beta and not fully documented for advanced use cases like this one Components documentation, Stack: Convex Components.

If you need to coordinate behavior between components, the recommended approach is to call both from your application code, ensuring they participate in the same transaction if needed. If you have a specific use case, you may want to follow updates to the component authoring APIs as they mature.

In summary:
There is no documented or supported way to use the migration component (or any component) from within another custom component at this time.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: