GrapesJS / grapesjs

Free and Open source Web Builder Framework. Next generation tool for building templates without coding
https://grapesjs.com
BSD 3-Clause "New" or "Revised" License
22.36k stars 4.05k forks source link

reload prev data for custome react component plugin after reload page #2855

Closed i3laddin closed 4 years ago

i3laddin commented 4 years ago

Hello @artf i am working with that awesome tool for long time i integrate it with react , and create a react plugin component for it , and create custom trait to get data from api and render it throw the plugin , i setup a local storage and also make a button to save all data in the local storage and db but i have a little problem , that when i reload page , all data for the custom component gone , and load the default setup , despite of all the others plugin keep it's own data when reload page , sorry if i didn't follow template for the issue , this is my first time to post my question on git , so if i made a mistake , just tell me and i will solve it thanks @artf

artf commented 4 years ago

For sure you didn't configure correctly the Storage Manager Please read carefully this guide https://grapesjs.com/docs/modules/Storage.html

i3laddin commented 4 years ago

thanks @artf for answer , i know how much time is important to you , but sorry for that , i configure it correctly , also i am get 200 for post request , also i get all of html and components and css for load request , but i have a little problem for prev traits for component , and render prev data image image image

and my porblem is i can't save that traits and get the same data from storage after reload editor and this screen to show that data and traits below

image

so when i reload editor it will like this

image

it's render the default data for component when first initial , not the final data which i stored in db even html data in canvas or the traits and options for component

i am sorry to bother you @artf , and wish you can help !

artf commented 4 years ago

How did you define that custom component?