Problem
BaseComponent.render() nukes the entire Shadow DOM tree and rebuilds from scratch on every state change. This causes:
- Layout thrashing / flicker
- Loss of focus state
- Loss of scroll position
- Poor performance with many events
Fix
Implement incremental/differential rendering. Only update the parts of the DOM that actually changed. Consider a simple virtual DOM diff or targeted DOM patches.
Problem
BaseComponent.render()nukes the entire Shadow DOM tree and rebuilds from scratch on every state change. This causes:Fix
Implement incremental/differential rendering. Only update the parts of the DOM that actually changed. Consider a simple virtual DOM diff or targeted DOM patches.