Integrating Custom Components into the Appmaker App's Root
Use Cases:
This can be useful in various scenarios. For instance, you might need to inject a component at the root level or add a listener when the app starts. It can also be utilized for in-app pop up notifications.
Note:
Ensure that you place this filter outside any activate function and declare it on a global level.
Usage:
const CustomComponent = (props) => {
// your custom logic
return (
<View>
<Text></Text>
</View>
);
};
addFilter("app-custom-root-components", "test-case", (currentComponents) => {
currentComponents?.push(CustomComponent);
return currentComponents;
});
The parameter currentComponents
will be an array containing the existing custom components. Be sure to add your component to this array without replacing any existing components.