react-email-editor icon indicating copy to clipboard operation
react-email-editor copied to clipboard

Legacy mode can't load another design after the first

Open abiliomg opened this issue 4 years ago • 1 comments

this.editor.loadDesign({ html: this.props.templateHtml, classic: true, }); i'm using this to load the design, but only works the first time, if i try to load another the editor doesn't change

abiliomg avatar Sep 24 '21 12:09 abiliomg

I had the same issue and fixed it by first loading blank design. (a bit hacky solution)

  useEffect(() => {
      unlayer.loadBlank()
      unlayer.loadDesign({
        html: template.body,
        classic: true,
      })
    }
  }, [template])

Hope it helps! Using vanilla unlayer in functional component with React 17.

PeterKarpinski avatar Mar 08 '22 09:03 PeterKarpinski