-
Notifications
You must be signed in to change notification settings - Fork 14
Register/ Render custom component #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Register/ Render custom component #33
Conversation
|
||
var blocks: [BuilderBlockModel] | ||
var componentType: BuilderComponentType = .box | ||
static let componentType: BuilderComponentType = .box |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why have these been made static?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static to make it visible externally during registration without the need to repeat the type instantiation.
eg. for the internal component registration workflow
- register(type: BuilderImage.componentType, viewClass: BuilderImage.self)
It enables easier custom component registration
- BuilderComponentRegistry.shared.registerCustomComponent(
componentView: RatingsComponent.self, apiKey: "###############")
which internally performs registry[componentView.componentType] = componentView
Added ability to render custom components by registering based on name. Also added calls to register custom components when the app is launched in appetize builder frontend.
Check example https://github.com/aarondemelo/BuilderIOExample as an example to register new components