Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Legacy mode can't load another design after the first #212

Open
abiliomg opened this issue Sep 24, 2021 · 1 comment
Open

Legacy mode can't load another design after the first #212

abiliomg opened this issue Sep 24, 2021 · 1 comment

Comments

@abiliomg
Copy link

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

@PeterKarpinski
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants