Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

Memorize Svelte Components Across Parents

$
0
0

I'm implementing a view layer for a markdown editor in svelte 5.

I've already created an incremental parser that parses markdown to MDAst.

MDAst parse a markdown source file as a hierarchy of sections.

<section><h1>Some Heading</h1><p>A huge paragraph</p><p>Another huge paragraph</p></section>

Therefore, when I insert a header, it will split the current section into two sections. In this case, it seems like svelte will remove some children and re-create these children into the newly created section. These components are sometimes large, and these edits cause can visible stucks in rendering.

<section><h1>Some Heading</h1><p>A huge paragraph</p></section><section><h1>Another Heading</h1><p>Another huge paragraph</p></section>

My question is, if I want to cache these children elements across rendering life cycles, what should I do?


Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>