Issue #2127💬 AnsweredOpened July 10, 2019by zyxnowell0 reactions

How to update content prop from trait event

Quick answerby artf

First of all, move all the props from block to the component to have something like this: otherwise, you can face unexpected behaviorsWhat I want to do is whenever the updated or doStuff event is called in the canvas-options it will update the prop chartType in the content of the component. To update the script in the...

Read full answer below ↓

Question

Hello, I want to update the content property based on the changes from the trait I have this component added and notice I have a custom property chartType which is the one that I would be needing to update. Here is the Trait that I created: What I want to do is whenever the updated or doStuff event is called in the canvas-options it will update the prop chartType in the content of the component. Is this possible? Thank you for anyone that could help me.

Answers (1)

artfJuly 14, 2019

First of all, move all the props from block to the component to have something like this: otherwise, you can face unexpected behaviorsWhat I want to do is whenever the updated or doStuff event is called in the canvas-options it will update the prop chartType in the content of the component. To upda...

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.