react-email-editor
react-email-editor copied to clipboard
Pass data to custom tools after editor initialization
Hi,
I'm building a custom tool much like the product library custom tool But, in order to paginate, search and show available products I would like to be able to pass and change the data after the initialization of the editor
there's a clear way to pass data to a custom tool but it seems that there's no way to update or pass again different data after the initialization
Thank you very much
@eladkarakuli Hmm that's an interesting problem.
You could trigger a forced re-render of the Editor component whenever the data is updated in order to reflect the changes? This would mean holding editor state in some sort of wrapper component around the editor (so you don't lose it on re-render) and managing it via the design:updated
event listener.
The problem is not re-rendering, the problem is being able to paginate through a list API endpoint. Say your product custom tool had thousands of products, how could we go about allowing the user to search for those products and insert any of them?
It's unrealistic to expect an API to return all products without pagination, but data can only be passed when initializing, and will not contain all products.
did anyone find the solution to this issue?