Issue #2808πŸ’¬ AnsweredOpened May 27, 2020by robertraf1 reactions

Custom type component in production environment

Quick answerby Ju99ernaut❀ 1

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)

Ju99ernautβ€’ May 31, 2020

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:

Ju99ernautβ€’ May 28, 2020

I think in a production environment all you need is the html and css code generated by grapesjs.

robertrafβ€’ May 30, 2020

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.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins β†’
Premium option

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.