Custom type component in production environment
onRender simply specifies what should happen when you successfully place a component onto the canvas, whereas script is code that will be generated in your html inside script tags. Something like:
Read full answer below βQuestion
Hi, I have a question, when I create a custom type component from the editor, what would be the next step to show that component in my application? Currently I am saving the component data in firebase with the firestore plugin, the attributes that are stored in the object are the following: gjs-assets, gjs-components, gjs-css, gjs-html and gjs.styles.
What would be next if I want to use these components in my production environment? Should I use a javascript framework or library? or maybe the same grape editor without the ability to edit, thanks.
Answers (3)
onRender simply specifies what should happen when you successfully place a component onto the canvas, whereas script is code that will be generated in your html inside script tags. Something like:
I think in a production environment all you need is the html and css code generated by grapesjs.
I understand that part, but if I want to render the component I have created it doesn't work. I'll explain a little, I have created a type of component that renders data from an endpoint, if I use the html and css code it doesn't work. Custom Component Type editor.DomComponents.addType('group', { m...
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3136
Create one more key in JSON
{ "type": "text", "status": "hovered", "content": "Insert your text here", "attributes": { "id": "ixx2" }, "activeOnRender": 0, "open": fal...
Issue #3409
[QUESTION] Custom component property that is not a trait
I would like to create a custom component with a property that will be updated by specific code, but I don't want this property to be visib...
Issue #3174
Creating a new component type does not inherit the functions of it's parent type
Hello, I am trying to create a new common trait shared among all components by creating the following plugin on another plugin file I am al...
Issue #2189
[Question] How to add "Ordered/Unordered List" option in rte/custom block
Hi I'm trying to create an ordered list with grapesjs. I tried adding the following to the rte: And this works if my page is pre-filled wit...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins βPremium plugins ship with support, regular updates, and production-ready features β save days of integration work.
Browse premium plugins βBrowse Plugin Categories
Jump directly to plugin category pages on the marketplace.