We recently started a new project using React4XP version 6. However, we are having trouble rendering the [embed] macro.
When I add this macro inside an HTMLArea of my app, it returns this error in the console:
Macro “embed” is not registered in ComponentRegistry!
To make it work in React4XP 6, would I need to implement the component and declare it in the componentRegistry? Or is there a way to do this so that it works with any component external to my app?
Another problem I’ve noticed recently is that if I try to render a part from another app (for example, from Form Builder), I also get the same type of error.
For rendering a part from another app you need to make sure to use the other app’s prefix when you add mapping to componentRegistry.tsx and plug in rendering processor in dataFetcher. This is also described in the tutorial above.
But the [embed] macro is built-in in Enonic. Would I still need to implement its processor, register it in the componentRegistry and in the dataFetcher?
And would I also need to do the same for each external app that the user installs (reimplement the processor and register it in the componentRegistry/dataFetcher)?
It doesn’t matter where the macro is coming from. Yes, [embed] is a built-in macro, but React4XP is an external rendering engine which doesn’t know about this macro. Every component you want to render has to be added to React4XP’s componentRegistry.
And would I also need to do the same for each external app that the user installs (reimplement the processor and register it in the componentRegistry/dataFetcher)?
Of course. I’m not sure what you mean by “reimplement” - I believe each part will have its own implementation.