question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

innerHTML broken for some frameworks

See original GitHub issue

Reproduction

For React, React Native, Vue, and Angular there are two sets of quotes.

For Svelte it should use @html.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
decadef20commented, May 24, 2022

@decadef20 can you update this for every framework

Sure

1reaction
samijabercommented, Mar 14, 2022

Thanks for raising this bug @sachinraja 🙏🏽.

If you (or anyone else) are interested in contributing a fix for this, here is some context pointing out how to do so:

Here is where innerHTML is handled in the react generator:

https://github.com/BuilderIO/mitosis/blob/85ed03dd886ffe258974dda619c313eff9893354/packages/core/src/generators/react.ts#L90-L99

All that needs to be done is adjust the logic here to handle the quotes properly. Afterwards, a similar change will need to be applied to the other frameworks. In some cases, frameworks might not yet have a BINDING_MAPPERS object, so that might have to be added from scratch

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - .InnerHTML Not working properly in Internet Explorer
innerHTML won't work in IE, but using DOM methods it will: function getValue() { var x=document.getElementById("myHeader") , link = document.
Read more >
innerHTML works in Firefox but not in Chrome : r/javascript
This attribute ( innerHTML ) is very basic and works in Chrome like it does in FF. It would be interesting to know...
Read more >
What is the Disadvantage of using innerHTML in JavaScript
But there are some disadvantages to using innerHTML in JavaScript. ... Even broken HTML can be used, which may lead to unexpected problems....
Read more >
Triggering Actions Inside InnerHTML Content | by David Geller
Directly connecting content within innerHTML areas with functions that normally respond to Ionic Framework pages isn't immediately obvious. So, ...
Read more >
Adding same spfx webpart(no javascript framework) with ...
innerHTML = html;. And likewise, change the line in your else condition to linksDiv.innerHTML = "No users in the Active Directory Group";.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found