Frontmatter
| id | 8080 |
| title | LivePreview: Reuse Markdown component reference to avoid re-creation |
| state | Closed |
| labels | enhancementai |
| assignees | tobiu |
| createdAt | Dec 10, 2025, 3:07 PM |
| updatedAt | Dec 10, 2025, 3:30 PM |
| githubUrl | https://github.com/neomjs/neo/issues/8080 |
| author | tobiu |
| commentsCount | 0 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Dec 10, 2025, 3:30 PM |
In
src/code/LivePreview.mjs, updatedoRunSourceto reuse the existingNeo.component.Markdowninstance if it exists and is valid.Logic:
container.add()inme.markdownComponent.doRunSource, ifme.markdownComponentexists and is not destroyed, update itsvalue.container.removeAll()andcontainer.add(), storing the new reference.This prevents the component from being destroyed/recreated on every keystroke, avoiding unnecessary parent VDOM updates and race conditions.