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

How to remove old content after get new content? #54

Open
nhatcuongboy opened this issue Nov 10, 2022 · 1 comment
Open

How to remove old content after get new content? #54

nhatcuongboy opened this issue Nov 10, 2022 · 1 comment

Comments

@nhatcuongboy
Copy link

When I get content from API, it will be dynamic.
let data = callApi(); <InnerHTML html={data} />

My data look like:

<form>
<p>{title}</p>
</form>
<script>
function test(){}
</script>

Now, how to remove old content after get new content?
Because, after get new content, It will notify some error like: "Uncaught SyntaxError: Identifier 'form' has already been declared"

Please help me this issue. Thanks

@christo-pr
Copy link
Owner

I'll change as long as you properly update the content, this repo contains an example of how to do it, also, not sure if the interpolation will work here: {title} since all the content rendered will be outside React context

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