Custom DomComponents events resetting after a refresh #4864
Unanswered
FarazBukhari
asked this question in
Q&A
Replies: 1 comment
-
Be sure to place your custom component code as a plugin. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've recently started using GrapeJS so i'm new to all the features in it. I'm integrating it into my React app and I've been trying to add a custom block that is basically a Sign Up button which will have custom functionality and open a modal that contains a form. My question is this:
Every time I drag and drop the button on to the canvas, my
onClick
functionality works as expected within the canvas. But if I refresh the page, all the traits, styling and any events I have defined get reset too. The rest of the template is still stored inside mylocalStorage
. I have set the Storage Manager totrue
inside my config file and I'm not sure what seems to be the problem.Is this happening because every time I open the page that contains the canvas, the config is reinitialised? (even if that is the case I have initialised all the settings within a
useEffect
)Or is this happening because I am missing a config parameter for any custom components?
I have tried defining attributes
as well as extending the view for the DomComponent and using scripts to run my functions
The problem isn't the function not running, rather the click events not being retained after a refresh.
Beta Was this translation helpful? Give feedback.
All reactions