Skip to content
Discussion options

You must be logged in to vote

This approach is fine and should perform well, especially if the HTML content you want to embed is simple (like an <a> tag). You may optionally return HTMLElement values (not HTML string text, but the HTMLElement objects themselves) directly as data in your setDataListener callback, which can help optimize HTML content which is expensive to mount/dismount, or which causes undue layout thrashing when mounting.

Note that if you do this for expensive elements, you'll want to be careful smartly caching-re-using these physical DOM elements as the users' viewport moves. Otherwise you may introduce flickering or a frame-rate degradation.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by paul-maki
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #220 on January 09, 2025 20:04.